Class: Cadenza::GenericBlockNode
- Inherits:
-
Object
- Object
- Cadenza::GenericBlockNode
- Defined in:
- lib/cadenza/nodes/generic_block_node.rb
Overview
The GenericBlockNode allows the end user of Cadenza to provide custom block rendering logic via a proc defined on Context.
Instance Attribute Summary collapse
-
#children ⇒ Array
A list of Node objects which are this block’s child nodes.
-
#identifier ⇒ String
The name of the block as defined in Context.
-
#parameters ⇒ Array
A list of Node objects which hold the value of parameters passed to this block.
Instance Method Summary collapse
-
#==(rhs) ⇒ Boolean
True if the given node is equivalent by value to the current node.
-
#implied_globals ⇒ Array
A list of variable names implied to be globals in the node.
-
#initialize(identifier, children, parameters = []) ⇒ GenericBlockNode
constructor
Creates a new generic block with the given name, children and parameters.
Constructor Details
#initialize(identifier, children, parameters = []) ⇒ GenericBlockNode
Creates a new generic block with the given name, children and parameters.
20 21 22 23 24 |
# File 'lib/cadenza/nodes/generic_block_node.rb', line 20 def initialize(identifier, children, parameters=[]) @identifier = identifier @children = children @parameters = parameters end |
Instance Attribute Details
#children ⇒ Array
Returns a list of Node objects which are this block’s child nodes.
9 10 11 |
# File 'lib/cadenza/nodes/generic_block_node.rb', line 9 def children @children end |
#identifier ⇒ String
Returns the name of the block as defined in Context.
6 7 8 |
# File 'lib/cadenza/nodes/generic_block_node.rb', line 6 def identifier @identifier end |
#parameters ⇒ Array
Returns a list of Node objects which hold the value of parameters passed to this block.
13 14 15 |
# File 'lib/cadenza/nodes/generic_block_node.rb', line 13 def parameters @parameters end |
Instance Method Details
#==(rhs) ⇒ Boolean
Returns true if the given node is equivalent by value to the current node.
36 37 38 39 40 |
# File 'lib/cadenza/nodes/generic_block_node.rb', line 36 def ==(rhs) @identifier == rhs.identifier and @children == rhs.children and @parameters == rhs.parameters end |
#implied_globals ⇒ Array
not yet implemented
Returns a list of variable names implied to be globals in the node.
28 29 30 31 |
# File 'lib/cadenza/nodes/generic_block_node.rb', line 28 def implied_globals #TODO: implement me please, kthxbai [] end |