Class: Rubasteme::AST::CondClauseNode
- Inherits:
-
HoldingSequenceBaseNode
- Object
- Node
- BranchNode
- ListNode
- HoldingSequenceBaseNode
- Rubasteme::AST::CondClauseNode
- Defined in:
- lib/rubasteme/ast/branch_node.rb
Instance Method Summary collapse
-
#initialize(_ = nil) ⇒ CondClauseNode
constructor
A new instance of CondClauseNode.
- #test ⇒ Object
- #test=(node) ⇒ Object
Methods inherited from HoldingSequenceBaseNode
Methods inherited from ListNode
#elements, #empty?, #first, #rest
Methods inherited from BranchNode
#<<, #[], #[]=, #each, #size, #to_a
Methods inherited from Node
Constructor Details
#initialize(_ = nil) ⇒ CondClauseNode
Returns a new instance of CondClauseNode.
307 308 309 310 311 312 |
# File 'lib/rubasteme/ast/branch_node.rb', line 307 def initialize(_ = nil) # type 1: @nodes = [<test>, <sequence>] # type 2: @nodes = [<test>] # - <sequence> is empty super(2, 1, _) end |
Instance Method Details
#test ⇒ Object
314 315 316 |
# File 'lib/rubasteme/ast/branch_node.rb', line 314 def test @nodes[0] end |
#test=(node) ⇒ Object
318 319 320 |
# File 'lib/rubasteme/ast/branch_node.rb', line 318 def test=(node) @nodes[0] = node end |