Class: Convection::Model::Attributes::Stack
- Inherits:
-
Object
- Object
- Convection::Model::Attributes::Stack
- Defined in:
- lib/convection/model/attributes.rb
Instance Attribute Summary collapse
-
#outputs ⇒ Object
Returns the value of attribute outputs.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#resources ⇒ Object
Returns the value of attribute resources.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #include?(key) ⇒ Boolean
-
#initialize ⇒ Stack
constructor
A new instance of Stack.
Constructor Details
#initialize ⇒ Stack
Returns a new instance of Stack
12 13 14 15 16 |
# File 'lib/convection/model/attributes.rb', line 12 def initialize @resources = {} @outputs = {} @parameters = {} end |
Instance Attribute Details
#outputs ⇒ Object
Returns the value of attribute outputs
9 10 11 |
# File 'lib/convection/model/attributes.rb', line 9 def outputs @outputs end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters
10 11 12 |
# File 'lib/convection/model/attributes.rb', line 10 def parameters @parameters end |
#resources ⇒ Object
Returns the value of attribute resources
8 9 10 |
# File 'lib/convection/model/attributes.rb', line 8 def resources @resources end |
Instance Method Details
#[](key) ⇒ Object
22 23 24 |
# File 'lib/convection/model/attributes.rb', line 22 def [](key) @parameters[key.to_s] || @outputs[key.to_s] || @resources[key.to_s] end |
#[]=(key, value) ⇒ Object
26 27 28 |
# File 'lib/convection/model/attributes.rb', line 26 def []=(key, value) @parameters[key.to_s] = value end |
#include?(key) ⇒ Boolean
18 19 20 |
# File 'lib/convection/model/attributes.rb', line 18 def include?(key) @parameters.include?(key) || @outputs.include?(key) || @resources.include?(key) end |