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
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
avalara_sdk-24.12.1 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
avalara_sdk-24.12.0 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
moneykit-0.1.15 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
moneykit-0.1.14 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
mux_ruby-3.18.0 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
moneykit-0.1.13 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
moneykit-0.1.12 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
moneykit-0.1.11 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
mux_ruby-3.17.0 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.10.2/lib/rspec/support/source/location.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.10.2/lib/rspec/support/source/location.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/rspec-support-3.10.2/lib/rspec/support/source/location.rb
moneykit-0.1.10 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
moneykit-0.1.9 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib/rspec/support/source/location.rb
mux_ruby-3.15.0 vendor/bundle/ruby/3.2.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/rspec-support-3.11.0/lib/rspec/support/source/location.rb