Class: Rubasteme::AST::CondNode
- Inherits:
-
ListNode
- Object
- Node
- BranchNode
- ListNode
- Rubasteme::AST::CondNode
- Defined in:
- lib/rubasteme/ast/branch_node.rb
Instance Method Summary collapse
- #add_clause(node) ⇒ Object
- #cond_clauses ⇒ Object
-
#initialize(_ = nil) ⇒ CondNode
constructor
A new instance of CondNode.
Methods inherited from ListNode
#elements, #empty?, #first, #rest
Methods inherited from BranchNode
#<<, #[], #[]=, #each, #size, #to_a
Methods inherited from Node
Constructor Details
#initialize(_ = nil) ⇒ CondNode
Returns a new instance of CondNode.
293 294 295 |
# File 'lib/rubasteme/ast/branch_node.rb', line 293 def initialize(_ = nil) super(0, _) end |
Instance Method Details
#add_clause(node) ⇒ Object
301 302 303 |
# File 'lib/rubasteme/ast/branch_node.rb', line 301 def add_clause(node) @nodes << node end |
#cond_clauses ⇒ Object
297 298 299 |
# File 'lib/rubasteme/ast/branch_node.rb', line 297 def cond_clauses @nodes[0..-1] end |