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.



9
10
11
# File 'lib/basic101/statement.rb', line 9

def index=(value)
  @index = value
end

#line=(value) ⇒ Object (writeonly)

Sets the attribute line

Parameters:

  • value

    the value to set the attribute line to.



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

def line=(value)
  @line = value
end

Instance Method Details

#data_itemsObject



17
18
19
# File 'lib/basic101/statement.rb', line 17

def data_items
  []
end

#exec(runtime) ⇒ Object



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

def exec(runtime)
end

#line_numberObject



21
22
23
# File 'lib/basic101/statement.rb', line 21

def line_number
  @line.line_number
end

#raise_error_with_line_number(exception) ⇒ Object

Raises:

  • (exception)


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

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