Class: Basic101::ElseStatement
- Defined in:
- lib/basic101/else_statement.rb
Instance Attribute Summary collapse
-
#end_statement ⇒ Object
writeonly
Sets the attribute end_statement.
Attributes inherited from Statement
Instance Method Summary collapse
- #execute(runtime) ⇒ Object
- #goto_following_statement(runtime) ⇒ Object
-
#initialize ⇒ ElseStatement
constructor
A new instance of ElseStatement.
Methods inherited from Statement
#data_items, #exec, #line_number, #raise_error_with_line_number
Methods included from Identity
Constructor Details
#initialize ⇒ ElseStatement
Returns a new instance of ElseStatement.
11 12 |
# File 'lib/basic101/else_statement.rb', line 11 def initialize end |
Instance Attribute Details
#end_statement=(value) ⇒ Object (writeonly)
Sets the attribute end_statement
9 10 11 |
# File 'lib/basic101/else_statement.rb', line 9 def end_statement=(value) @end_statement = value end |
Instance Method Details
#execute(runtime) ⇒ Object
14 15 16 |
# File 'lib/basic101/else_statement.rb', line 14 def execute(runtime) @end_statement.goto_following_statement(runtime) end |
#goto_following_statement(runtime) ⇒ Object
18 19 20 |
# File 'lib/basic101/else_statement.rb', line 18 def goto_following_statement(runtime) runtime.goto_index(@index + 1) end |