Class: Qrpm::DirectoryNode

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

Instance Attribute Summary collapse

Attributes inherited from Node

#expr, #name, #parent, #path

Instance Method Summary collapse

Methods inherited from ArrayNode

#dump, #exprs

Methods inherited from ContainerNode

#exprs, #signature, #values

Methods inherited from Node

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

Constructor Details

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

Returns a new instance of DirectoryNode.



378
379
380
381
# File 'lib/qrpm/node.rb', line 378

def initialize(parent, name, array = [])
  constrain name, Fragment::Fragment
  super
end

Instance Attribute Details

#keyObject (readonly)

Override Qrpm#key



373
374
375
# File 'lib/qrpm/node.rb', line 373

def key
  @key
end

Instance Method Details

#directoryObject

File system path to the directory. An alias for uuid/key



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

def directory() key end

#interpolate(dict) ⇒ Object

A directory node also interpolates its key



387
388
389
390
391
392
# File 'lib/qrpm/node.rb', line 387

def interpolate(dict)
  # #key is used by the embedded files to compute their paths so it has be
  # interpolated before we interpolate the files through the +super+ method
  @key = name.interpolate(dict) 
  super
end

#key_variablesObject



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

def key_variables() @key_variables ||= name.variables end

#variablesObject



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

def variables() (super + key_variables).uniq end