Class: Environment
- Inherits:
-
Object
- Object
- Environment
- Defined in:
- lib/environment.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#name ⇒ Object
Returns the value of attribute name.
-
#variables ⇒ Object
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Environment
constructor
A new instance of Environment.
Constructor Details
#initialize(hash) ⇒ Environment
Returns a new instance of Environment.
4 5 6 7 8 9 10 11 |
# File 'lib/environment.rb', line 4 def initialize(hash) @name = hash[:name] || hash['name'] || '' @endpoint = hash[:endpoint] || hash['endpoint'] || '' @variables = hash[:vars] || hash['vars'] || {} @headers = hash[:headers] || hash['headers'] || {} # TODO raise exceptions when @name or @endpoint is nil or empty end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
2 3 4 |
# File 'lib/environment.rb', line 2 def endpoint @endpoint end |
#headers ⇒ Object
Returns the value of attribute headers.
2 3 4 |
# File 'lib/environment.rb', line 2 def headers @headers end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/environment.rb', line 2 def name @name end |
#variables ⇒ Object
Returns the value of attribute variables.
2 3 4 |
# File 'lib/environment.rb', line 2 def variables @variables end |