Sha256: e19e1724781358dd886a1fa6e4253ea278d4e0952323ca1f1e71e47fec0fc8cb

Contents?: true

Size: 567 Bytes

Versions: 2010

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

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

2,010 entries across 2,010 versions & 15 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb
cybrid_api_organization_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib/rspec/support/source/location.rb