Class: Basic101::GotoStatement
- Defined in:
- lib/basic101/goto_statement.rb
Instance Attribute Summary
Attributes inherited from Statement
Instance Method Summary collapse
- #execute(runtime) ⇒ Object
-
#initialize(target_line_number) ⇒ GotoStatement
constructor
A new instance of GotoStatement.
Methods inherited from Statement
#data_items, #exec, #line_number, #raise_error_with_line_number
Methods included from Identity
Constructor Details
#initialize(target_line_number) ⇒ GotoStatement
Returns a new instance of GotoStatement.
9 10 11 |
# File 'lib/basic101/goto_statement.rb', line 9 def initialize(target_line_number) @target_line_number = target_line_number end |
Instance Method Details
#execute(runtime) ⇒ Object
[View source]
13 14 15 |
# File 'lib/basic101/goto_statement.rb', line 13 def execute(runtime) runtime.goto_line(@target_line_number) end |