Class: Forthic::CodeLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/forthic/code_location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(screen_name: "<ad-hoc>", line: 1, column: 1, start_pos: 0, end_pos: 0) ⇒ CodeLocation

Returns a new instance of CodeLocation.

Parameters:

  • screen_name (String) (defaults to: "<ad-hoc>")
  • line (Integer) (defaults to: 1)
  • column (Integer) (defaults to: 1)
  • start_pos (Integer) (defaults to: 0)
  • end_pos (Integer) (defaults to: 0)


12
13
14
15
16
17
18
# File 'lib/forthic/code_location.rb', line 12

def initialize(screen_name: "<ad-hoc>", line: 1, column: 1, start_pos: 0, end_pos: 0)
  @screen_name = screen_name
  @line = line
  @column = column
  @start_pos = start_pos
  @end_pos = end_pos
end

Instance Attribute Details

#columnObject

Returns the value of attribute column.



5
6
7
# File 'lib/forthic/code_location.rb', line 5

def column
  @column
end

#end_posObject

Returns the value of attribute end_pos.



5
6
7
# File 'lib/forthic/code_location.rb', line 5

def end_pos
  @end_pos
end

#lineObject

Returns the value of attribute line.



5
6
7
# File 'lib/forthic/code_location.rb', line 5

def line
  @line
end

#screen_nameObject

Returns the value of attribute screen_name.



5
6
7
# File 'lib/forthic/code_location.rb', line 5

def screen_name
  @screen_name
end

#start_posObject

Returns the value of attribute start_pos.



5
6
7
# File 'lib/forthic/code_location.rb', line 5

def start_pos
  @start_pos
end