Sha256: 76e6f4ec47bc45e7fd9203affb8bc62aff5e4756367203bb53d3674e306bd591

Contents?: true

Size: 536 Bytes

Versions: 5218

Compression:

Stored size: 536 Bytes

Contents

module RSpec
  module Support
    class Source
      # @private
      # Represents a source location of node or token.
      Location = Struct.new(:line, :column) do
        include Comparable

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

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

Version data entries

5,218 entries across 5,143 versions & 96 rubygems

Version Path
cybrid_api_organization_ruby-0.113.101 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.113.100 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.113.100 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.113.100 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.113.99 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.113.99 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.113.99 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.113.98 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.113.98 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.113.98 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.113.96 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.113.96 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.113.96 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.113.95 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.113.95 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.113.95 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.113.94 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.113.94 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.113.94 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.113.93 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb