Class: Context
- Inherits:
-
Object
- Object
- Context
- Defined in:
- lib/context.rb
Instance Attribute Summary collapse
-
#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) ⇒ Context
constructor
A new instance of Context.
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
#headers ⇒ Object
Returns the value of attribute headers.
2 3 4 |
# File 'lib/context.rb', line 2 def headers @headers end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/context.rb', line 2 def name @name end |
#variables ⇒ Object
Returns the value of attribute variables.
2 3 4 |
# File 'lib/context.rb', line 2 def variables @variables end |