Class: Babl::Operators::Pin::CreatePinNode

Inherits:
Object
  • Object
show all
Defined in:
lib/babl/operators/pin.rb

Instance Method Summary collapse

Constructor Details

#initialize(node, ref) ⇒ CreatePinNode

Returns a new instance of CreatePinNode.



24
25
26
27
# File 'lib/babl/operators/pin.rb', line 24

def initialize(node, ref)
    @node = node
    @ref = ref
end

Instance Method Details

#dependenciesObject



37
38
39
# File 'lib/babl/operators/pin.rb', line 37

def dependencies
    Babl::Utils::Hash.deep_merge(node.dependencies, node.pinned_dependencies[ref] || {})
end

#documentationObject



33
34
35
# File 'lib/babl/operators/pin.rb', line 33

def documentation
    node.documentation
end

#pinned_dependenciesObject



41
42
43
# File 'lib/babl/operators/pin.rb', line 41

def pinned_dependencies
    node.pinned_dependencies.reject { |k, _v| k == ref }
end

#render(ctx) ⇒ Object



29
30
31
# File 'lib/babl/operators/pin.rb', line 29

def render(ctx)
    node.render(ctx.create_pin(ref))
end