Class: Kubes::Compiler::Decorator::Base
- Inherits:
-
Object
- Object
- Kubes::Compiler::Decorator::Base
- Defined in:
- lib/kubes/compiler/decorator/base.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
- #result ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/kubes/compiler/decorator/base.rb', line 4 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/kubes/compiler/decorator/base.rb', line 3 def data @data end |
Instance Method Details
#result ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/kubes/compiler/decorator/base.rb', line 13 def result if @data.key?(Kubes::Compiler::Dsl::Core::Blocks) @data.results.each { |k,v| run(v) } # returns nil else run # processes and returns @data end @data # important to return @data so we keep the original @data structure: Blocks or Hash end |