Class: Refract::CaseMatchNode

Inherits:
Node
  • Object
show all
Defined in:
lib/refract/nodes/case_match_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#conditionsObject

Returns the value of attribute conditions.



13
14
15
# File 'lib/refract/nodes/case_match_node.rb', line 13

def conditions
  @conditions
end

#else_clauseObject

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

#predicateObject

Returns the value of attribute predicate.



13
14
15
# File 'lib/refract/nodes/case_match_node.rb', line 13

def predicate
  @predicate
end