Class: Rjq::AST::Break

Inherits:
Node
  • Object
show all
Defined in:
lib/rjq/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#source_span

Instance Method Summary collapse

Methods inherited from Node

#assign_value, #invalid_path_message, #paths, #take, #with_source_span

Constructor Details

#initialize(label) ⇒ Break

Returns a new instance of Break.



775
776
777
# File 'lib/rjq/ast.rb', line 775

def initialize(label)
  @label = label
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



773
774
775
# File 'lib/rjq/ast.rb', line 773

def label
  @label
end

Instance Method Details

#eval(_input, _context) ⇒ Object

Raises:



779
780
781
# File 'lib/rjq/ast.rb', line 779

def eval(_input, _context)
  raise BreakSignal, @label
end