123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Support::Source::Location Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Comparable, Struct
Inherits: Struct
  • Object
Defined in: rspec-support/lib/rspec/support/source/location.rb

Overview

Represents a source location of node or token.

Class Method Summary

Instance Attribute Summary

  • #column rw Internal use only

    Represents a source location of node or token.

  • #line rw Internal use only

    Represents a source location of node or token.

Instance Method Summary

Class Method Details

.location?(array) ⇒ Boolean

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/source/location.rb', line 11

def self.location?(array)
  array.is_a?(Array) && array.size == 2 && array.all? { |e| e.is_a?(Integer) }
end

Instance Attribute Details

#column (rw)

Represents a source location of node or token.

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/source/location.rb', line 8

Location = Struct.new(:line, :column)

#line (rw)

Represents a source location of node or token.

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/source/location.rb', line 8

Location = Struct.new(:line, :column)

Instance Method Details

#<=>(other)

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/source/location.rb', line 15

def <=>(other)
  line_comparison = (line <=> other.line)
  return line_comparison unless line_comparison == 0
  column <=> other.column
end