Class: Babl::Operators::Object::ObjectNode
- Inherits:
-
Object
- Object
- Babl::Operators::Object::ObjectNode
- Defined in:
- lib/babl/operators/object.rb
Instance Method Summary collapse
- #dependencies ⇒ Object
- #documentation ⇒ Object
-
#initialize(nodes) ⇒ ObjectNode
constructor
A new instance of ObjectNode.
- #pinned_dependencies ⇒ Object
- #render(ctx) ⇒ Object
Constructor Details
#initialize(nodes) ⇒ ObjectNode
Returns a new instance of ObjectNode.
29 30 31 |
# File 'lib/babl/operators/object.rb', line 29 def initialize(nodes) @nodes = nodes end |
Instance Method Details
#dependencies ⇒ Object
33 34 35 |
# File 'lib/babl/operators/object.rb', line 33 def dependencies nodes.values.map(&:dependencies).reduce({}) { |a, b| Babl::Utils::Hash.deep_merge(a, b) } end |
#documentation ⇒ Object
41 42 43 |
# File 'lib/babl/operators/object.rb', line 41 def documentation nodes.map { |k, v| [k, v.documentation] }.to_h end |
#pinned_dependencies ⇒ Object
37 38 39 |
# File 'lib/babl/operators/object.rb', line 37 def pinned_dependencies nodes.values.map(&:pinned_dependencies).reduce({}) { |a, b| Babl::Utils::Hash.deep_merge(a, b) } end |
#render(ctx) ⇒ Object
45 46 47 |
# File 'lib/babl/operators/object.rb', line 45 def render(ctx) nodes.map { |k, v| [k, v.render(ctx)] }.to_h end |