Class: LiveTribe::Debut::Debutante
- Inherits:
-
Object
- Object
- LiveTribe::Debut::Debutante
- Defined in:
- lib/debut.rb
Constant Summary collapse
- USE_ENVIRONMENT =
'<use environment>'
- USE_LOCAL_HOSTNAME =
true
Instance Method Summary collapse
- #goodbye ⇒ Object
- #hello ⇒ Object
- #hostname ⇒ Object
- #hostname=(hostname) ⇒ Object
-
#initialize(attributes) ⇒ Debutante
constructor
A new instance of Debutante.
- #name ⇒ Object
- #name=(name) ⇒ Object
- #subdomain ⇒ Object
- #subdomain=(subdomain) ⇒ Object
- #to_s ⇒ Object
- #use_local_hostname ⇒ Object
- #use_local_hostname=(use_local_hostname) ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Debutante
Returns a new instance of Debutante.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/debut.rb', line 28 def initialize(attributes) provider = attributes[:provider].to_s.downcase.to_sym begin require "debut/#{provider}" if LiveTribe::Debut.providers.include?(provider) @provider = LiveTribe::Debut.providers[provider].new(attributes) else raise ArgumentError.new("#{provider} is not a recognized debut provider") end rescue LoadError raise ArgumentError.new("#{provider} is not a recognized debut provider") end @provider.use_local_hostname = USE_LOCAL_HOSTNAME end |
Instance Method Details
#goodbye ⇒ Object
80 81 82 |
# File 'lib/debut.rb', line 80 def goodbye @provider.goodbye end |
#hello ⇒ Object
76 77 78 |
# File 'lib/debut.rb', line 76 def hello @provider.hello end |
#hostname ⇒ Object
44 45 46 |
# File 'lib/debut.rb', line 44 def hostname @provider.hostname end |
#hostname=(hostname) ⇒ Object
48 49 50 |
# File 'lib/debut.rb', line 48 def hostname=(hostname) @provider.hostname = hostname end |
#name ⇒ Object
52 53 54 |
# File 'lib/debut.rb', line 52 def name @provider.name end |
#name=(name) ⇒ Object
56 57 58 |
# File 'lib/debut.rb', line 56 def name=(name) @provider.name = name end |
#subdomain ⇒ Object
60 61 62 |
# File 'lib/debut.rb', line 60 def subdomain @provider.subdomain end |
#subdomain=(subdomain) ⇒ Object
64 65 66 |
# File 'lib/debut.rb', line 64 def subdomain=(subdomain) @provider.subdomain = subdomain end |
#to_s ⇒ Object
84 85 86 |
# File 'lib/debut.rb', line 84 def to_s "#{@provider.name}.#{@provider.subdomain}:#{@provider.to_s}" end |
#use_local_hostname ⇒ Object
68 69 70 |
# File 'lib/debut.rb', line 68 def use_local_hostname @provider.use_local_hostname end |
#use_local_hostname=(use_local_hostname) ⇒ Object
72 73 74 |
# File 'lib/debut.rb', line 72 def use_local_hostname=(use_local_hostname) @provider.use_local_hostname = use_local_hostname end |