Sha256: 62d28d3a309c4db394291b5295d5f75e0a9e8b17e55eb319cc49053c4d9c25dc

Contents?: true

Size: 520 Bytes

Versions: 15

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true
module ActiveMocker
  class Relation < Collection
    include Queries

    def initialize(collection = [])
      super
      @from_limit = false
    end

    def inspect
      entries     = to_a.take(11).map!(&:inspect)
      entries[10] = "..." if entries.size == 11
      "#<#{name} [#{entries.join(", ")}]>"
    end

    def from_limit?
      @from_limit
    end

    private

    def set_from_limit
      @from_limit = true
    end

    def name
      self.class.name
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
active_mocker-2.5.1 lib/active_mocker/mock/relation.rb
active_mocker-2.5.1.pre lib/active_mocker/mock/relation.rb
active_mocker-2.5.0 lib/active_mocker/mock/relation.rb
active_mocker-2.4.4 lib/active_mocker/mock/relation.rb
active_mocker-2.4.3 lib/active_mocker/mock/relation.rb
active_mocker-2.4.2 lib/active_mocker/mock/relation.rb
active_mocker-2.4.1 lib/active_mocker/mock/relation.rb
active_mocker-2.4.0 lib/active_mocker/mock/relation.rb
active_mocker-2.4.0.pre5 lib/active_mocker/mock/relation.rb
active_mocker-2.3.4 lib/active_mocker/mock/relation.rb
active_mocker-2.4.0.pre4 lib/active_mocker/mock/relation.rb
active_mocker-2.4.0.pre3 lib/active_mocker/mock/relation.rb
active_mocker-2.4.0.pre2 lib/active_mocker/mock/relation.rb
active_mocker-2.4.0.pre1 lib/active_mocker/mock/relation.rb
active_mocker-2.3.3 lib/active_mocker/mock/relation.rb