Class: Qrpm::ArrayNode

Inherits:
ContainerNode show all
Defined in:
lib/qrpm/node.rb

Direct Known Subclasses

DirectoryNode

Instance Attribute Summary

Attributes inherited from Node

#expr, #name, #parent, #path

Instance Method Summary collapse

Methods inherited from ContainerNode

#signature, #values, #variables

Methods inherited from Node

#class_name, #dot, #inspect, #interpolated?, #signature, #traverse, #variables

Constructor Details

#initialize(parent, name, array = []) ⇒ ArrayNode

Returns a new instance of ArrayNode.



340
341
342
343
# File 'lib/qrpm/node.rb', line 340

def initialize(parent, name, array = [])
  constrain array, Array
  super(parent, name, array.dup)
end

Instance Method Details

#dumpObject



353
354
355
356
357
358
359
360
361
362
# File 'lib/qrpm/node.rb', line 353

def dump
  puts "["
  indent {
    expr.each { |n|
      print "- "
      n.dump
    }
  }
  puts "]"
end

#exprsObject

Override ContainerNode#exprs



338
# File 'lib/qrpm/node.rb', line 338

def exprs() expr end

#interpolate(dict) ⇒ Object

Array forwards #interpolate to its children



348
349
350
351
# File 'lib/qrpm/node.rb', line 348

def interpolate(dict)
  exprs.each { |e| e.interpolate(dict) }
  super
end