Class: Qrpm::HashNode
- Inherits:
-
ContainerNode
- Object
- Node
- ContainerNode
- Qrpm::HashNode
- Defined in:
- lib/qrpm/node.rb
Overview
A HashNode has a hash as expr. It doesn’t forward #interpolate to its members (FileNode overrides that)
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #dump ⇒ Object
-
#exprs ⇒ Object
Override ContainerNode#exprs.
-
#initialize(parent, name, hash = {}) ⇒ HashNode
constructor
A new instance of HashNode.
Methods inherited from ContainerNode
#signature, #values, #variables
Methods inherited from Node
#class_name, #dot, #inspect, #interpolate, #interpolated?, #signature, #traverse, #variables
Constructor Details
#initialize(parent, name, hash = {}) ⇒ HashNode
Returns a new instance of HashNode.
188 189 190 191 |
# File 'lib/qrpm/node.rb', line 188 def initialize(parent, name, hash = {}) constrain hash, Hash super(parent, name, hash.dup) end |
Instance Method Details
#dump ⇒ Object
195 196 197 198 199 200 201 202 203 204 |
# File 'lib/qrpm/node.rb', line 195 def dump puts "{" indent { expr.each { |k,v| print "#{k}: " v.dump } } puts "}" end |
#exprs ⇒ Object
Override ContainerNode#exprs
186 |
# File 'lib/qrpm/node.rb', line 186 def exprs() expr.values end |