Class: Convection::Model::Attributes::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/convection/model/attributes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStack

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

#outputsObject

Returns the value of attribute outputs



9
10
11
# File 'lib/convection/model/attributes.rb', line 9

def outputs
  @outputs
end

#parametersObject (readonly)

Returns the value of attribute parameters



10
11
12
# File 'lib/convection/model/attributes.rb', line 10

def parameters
  @parameters
end

#resourcesObject

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

Returns:

  • (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