Class: Refract::CaseMatchNode
- Defined in:
- lib/refract/nodes/case_match_node.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#else_clause ⇒ Object
Returns the value of attribute else_clause.
-
#predicate ⇒ Object
Returns the value of attribute predicate.
Instance Method Summary collapse
-
#initialize(prism_node: nil, predicate:, conditions:, else_clause:) ⇒ CaseMatchNode
constructor
A new instance of CaseMatchNode.
Methods inherited from Node
#accept, #copy, #start_line, #type, type
Constructor Details
#initialize(prism_node: nil, predicate:, conditions:, else_clause:) ⇒ CaseMatchNode
Returns a new instance of CaseMatchNode.
5 6 7 8 9 10 11 |
# File 'lib/refract/nodes/case_match_node.rb', line 5 def initialize(prism_node: nil, predicate:, conditions:, else_clause:) @prism_node = prism_node => Prism::Node | nil @predicate = predicate @conditions = conditions @else_clause = else_clause freeze end |
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
13 14 15 |
# File 'lib/refract/nodes/case_match_node.rb', line 13 def conditions @conditions end |
#else_clause ⇒ Object
Returns the value of attribute else_clause.
13 14 15 |
# File 'lib/refract/nodes/case_match_node.rb', line 13 def else_clause @else_clause end |
#predicate ⇒ Object
Returns the value of attribute predicate.
13 14 15 |
# File 'lib/refract/nodes/case_match_node.rb', line 13 def predicate @predicate end |