Class: DomainSwitcher::Website
- Inherits:
-
Object
- Object
- DomainSwitcher::Website
- Includes:
- ConfigBuilder
- Defined in:
- lib/domain_switcher/website.rb
Instance Attribute Summary collapse
-
#default_domain ⇒ Object
Returns the value of attribute default_domain.
-
#domains ⇒ Object
readonly
Returns the value of attribute domains.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
- #<<(domain) ⇒ Object
-
#[](domain) ⇒ Object
Retrieve a domain by the domain.
-
#initialize(name, symbol, conf = {}, domains = []) ⇒ Website
constructor
A new instance of Website.
Methods included from ConfigBuilder
#build_config!, #method_missing
Constructor Details
#initialize(name, symbol, conf = {}, domains = []) ⇒ Website
Returns a new instance of Website.
10 11 12 13 14 15 16 |
# File 'lib/domain_switcher/website.rb', line 10 def initialize(name, symbol, conf = {}, domains = []) @name = name @symbol = symbol @domains = domains @domains_hash = {} build_config!(conf) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class DomainSwitcher::ConfigBuilder
Instance Attribute Details
#default_domain ⇒ Object
Returns the value of attribute default_domain.
8 9 10 |
# File 'lib/domain_switcher/website.rb', line 8 def default_domain @default_domain end |
#domains ⇒ Object (readonly)
Returns the value of attribute domains.
7 8 9 |
# File 'lib/domain_switcher/website.rb', line 7 def domains @domains end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/domain_switcher/website.rb', line 5 def name @name end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
6 7 8 |
# File 'lib/domain_switcher/website.rb', line 6 def symbol @symbol end |
Instance Method Details
#<<(domain) ⇒ Object
18 19 20 21 |
# File 'lib/domain_switcher/website.rb', line 18 def <<(domain) @domains_hash[domain.domain] = domain @domains << domain end |
#[](domain) ⇒ Object
Retrieve a domain by the domain
24 25 26 |
# File 'lib/domain_switcher/website.rb', line 24 def [](domain) @domains_hash[domain] end |