Class: Qrpm::DirectoryNode
- Inherits:
-
ArrayNode
- Object
- Node
- ContainerNode
- ArrayNode
- Qrpm::DirectoryNode
- Defined in:
- lib/qrpm/node.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Override Qrpm#key.
Attributes inherited from Node
Instance Method Summary collapse
-
#directory ⇒ Object
File system path to the directory.
-
#initialize(parent, name, array = []) ⇒ DirectoryNode
constructor
A new instance of DirectoryNode.
-
#interpolate(dict) ⇒ Object
A directory node also interpolates its key.
- #key_variables ⇒ Object
- #variables ⇒ Object
Methods inherited from ArrayNode
Methods inherited from ContainerNode
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
#key ⇒ Object (readonly)
Override Qrpm#key
373 374 375 |
# File 'lib/qrpm/node.rb', line 373 def key @key end |
Instance Method Details
#directory ⇒ Object
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_variables ⇒ Object
384 |
# File 'lib/qrpm/node.rb', line 384 def key_variables() @key_variables ||= name.variables end |
#variables ⇒ Object
383 |
# File 'lib/qrpm/node.rb', line 383 def variables() (super + key_variables).uniq end |