Class: Basic101::Statement

Inherits:
Object
  • Object
show all
Includes:
Identity
Defined in:
lib/basic101/statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Identity

#==

Instance Attribute Details

#index=(value) ⇒ Object (writeonly)

Sets the attribute index

Parameters:

  • value

    the value to set the attribute index to.



11
12
13
# File 'lib/basic101/statement.rb', line 11

def index=(value)
  @index = value
end

#line=(value) ⇒ Object (writeonly)

Sets the attribute line

Parameters:

  • value

    the value to set the attribute line to.



12
13
14
# File 'lib/basic101/statement.rb', line 12

def line=(value)
  @line = value
end

Instance Method Details

#data_itemsObject



19
20
21
# File 'lib/basic101/statement.rb', line 19

def data_items
  []
end

#exec(runtime) ⇒ Object



27
28
# File 'lib/basic101/statement.rb', line 27

def exec(runtime)
end

#line_numberObject



23
24
25
# File 'lib/basic101/statement.rb', line 23

def line_number
  @line.line_number
end

#raise_error_with_line_number(exception) ⇒ Object

Raises:

  • (exception)


14
15
16
17
# File 'lib/basic101/statement.rb', line 14

def raise_error_with_line_number(exception)
  message = "Error on line #{@line.line_number}: #{exception}"
  raise exception, message, exception.backtrace
end