Class: Capricorn::Satellite
- Inherits:
-
Object
- Object
- Capricorn::Satellite
- Includes:
- Actions, Persistence, DRbUndumped
- Defined in:
- lib/capricorn/satellite.rb,
lib/capricorn/satellite/actions.rb,
lib/capricorn/satellite/persistence.rb,
lib/capricorn/satellite/dependency_loader.rb
Defined Under Namespace
Modules: Actions, Persistence Classes: DependencyLoader
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#engines ⇒ Object
readonly
Returns the value of attribute engines.
Instance Method Summary collapse
- #basedomain ⇒ Object
-
#initialize(domain) ⇒ Satellite
constructor
A new instance of Satellite.
- #subdomain ⇒ Object
- #subdomain? ⇒ Boolean
Methods included from Persistence
Methods included from Actions
#add_engine, #remove_engine, #update_engine
Constructor Details
#initialize(domain) ⇒ Satellite
Returns a new instance of Satellite.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/capricorn/satellite.rb', line 15 def initialize(domain) if Hash === domain domain.each do |name, value| instance_variable_set("@#{name}".to_sym, value) end else @domain = domain @engines = {} end @domain.gsub!(/^www\./, '') end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
13 14 15 |
# File 'lib/capricorn/satellite.rb', line 13 def domain @domain end |
#engines ⇒ Object (readonly)
Returns the value of attribute engines.
13 14 15 |
# File 'lib/capricorn/satellite.rb', line 13 def engines @engines end |
Instance Method Details
#basedomain ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/capricorn/satellite.rb', line 27 def basedomain unless @basedomain parts = self.domain.split('.') parts = parts[-2..-1] @basedomain = parts.join('.') end @basedomain end |
#subdomain ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/capricorn/satellite.rb', line 36 def subdomain unless @subdomain parts = self.domain.split('.') parts = parts[0..-3] @subdomain = parts.join('.') end @subdomain unless @subdomain == '' end |
#subdomain? ⇒ Boolean
45 46 47 |
# File 'lib/capricorn/satellite.rb', line 45 def subdomain? !self.subdomain.nil? end |