Class: Ronin::DB::URLScheme

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Model, Model::HasUniqueName
Defined in:
lib/ronin/db/url_scheme.rb

Overview

Represents a URL scheme.

Instance Attribute Summary collapse

Attributes included from Model::HasUniqueName

#name

Class Method Summary collapse

Methods included from Model::HasUniqueName

included

Methods included from Model

included

Instance Attribute Details

#idInteger

The primary key of the URL scheme.

Returns:

  • (Integer)


42
# File 'lib/ronin/db/url_scheme.rb', line 42

attribute :id, :integer

#urlsArray<URL>

The URLs that use the scheme.

Returns:



48
49
# File 'lib/ronin/db/url_scheme.rb', line 48

has_many :urls, class_name: 'URL',
foreign_key: :scheme_id

Class Method Details

.ftpURLScheme

The FTP URL Scheme

Returns:



74
75
76
# File 'lib/ronin/db/url_scheme.rb', line 74

def self.ftp
  where(name: 'ftp').first
end

.httpURLScheme

The HTTP URL Scheme

Returns:



56
57
58
# File 'lib/ronin/db/url_scheme.rb', line 56

def self.http
  where(name: 'http').first
end

.httpsURLScheme

The HTTPS URL Scheme

Returns:



65
66
67
# File 'lib/ronin/db/url_scheme.rb', line 65

def self.https
  where(name: 'https').first
end