Class: Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#endpointObject

Returns the value of attribute endpoint.



2
3
4
# File 'lib/environment.rb', line 2

def endpoint
  @endpoint
end

#headersObject

Returns the value of attribute headers.



2
3
4
# File 'lib/environment.rb', line 2

def headers
  @headers
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/environment.rb', line 2

def name
  @name
end

#variablesObject

Returns the value of attribute variables.



2
3
4
# File 'lib/environment.rb', line 2

def variables
  @variables
end