Class: Moult::Span

Inherits:
Struct
  • Object
show all
Defined in:
lib/moult/span.rb

Overview

A source location range for a definition. Lines are 1-based, columns are 0-based, matching Prism's location offsets. Part of the protected JSON contract and a component of a method's Phase 3 coverage join key.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#end_columnObject

Returns the value of attribute end_column

Returns:

  • (Object)

    the current value of end_column



7
8
9
# File 'lib/moult/span.rb', line 7

def end_column
  @end_column
end

#end_lineObject

Returns the value of attribute end_line

Returns:

  • (Object)

    the current value of end_line



7
8
9
# File 'lib/moult/span.rb', line 7

def end_line
  @end_line
end

#start_columnObject

Returns the value of attribute start_column

Returns:

  • (Object)

    the current value of start_column



7
8
9
# File 'lib/moult/span.rb', line 7

def start_column
  @start_column
end

#start_lineObject

Returns the value of attribute start_line

Returns:

  • (Object)

    the current value of start_line



7
8
9
# File 'lib/moult/span.rb', line 7

def start_line
  @start_line
end

Instance Method Details

#to_hObject



8
9
10
11
12
13
14
15
# File 'lib/moult/span.rb', line 8

def to_h
  {
    start_line: start_line,
    start_column: start_column,
    end_line: end_line,
    end_column: end_column
  }
end