Class: Refract::IfNode

Inherits:
Node
  • Object
show all
Defined in:
lib/refract/nodes/if_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:, statements: nil, subsequent: nil, inline:) ⇒ IfNode

Returns a new instance of IfNode.



5
6
7
8
9
10
11
12
# File 'lib/refract/nodes/if_node.rb', line 5

def initialize(prism_node: nil, predicate:, statements: nil, subsequent: nil, inline:)
	@prism_node = prism_node => Prism::Node | nil
	@predicate = predicate
	@statements = statements
	@subsequent = subsequent
	@inline = inline
	freeze
end

Instance Attribute Details

#inlineObject

Returns the value of attribute inline.



14
15
16
# File 'lib/refract/nodes/if_node.rb', line 14

def inline
  @inline
end

#predicateObject

Returns the value of attribute predicate.



14
15
16
# File 'lib/refract/nodes/if_node.rb', line 14

def predicate
  @predicate
end

#statementsObject

Returns the value of attribute statements.



14
15
16
# File 'lib/refract/nodes/if_node.rb', line 14

def statements
  @statements
end

#subsequentObject

Returns the value of attribute subsequent.



14
15
16
# File 'lib/refract/nodes/if_node.rb', line 14

def subsequent
  @subsequent
end