Class: Context

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Context

Returns a new instance of Context.



4
5
6
7
8
# File 'lib/context.rb', line 4

def initialize(hash)
  @name = hash[:name] || hash['name'] || 'default_context'
  @variables = hash[:vars] || hash['vars'] || {}
  @headers = hash[:headers] || hash['headers'] || {}
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



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

def headers
  @headers
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#variablesObject

Returns the value of attribute variables.



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

def variables
  @variables
end