Sha256: aad24073676d9aaf3a2d22d5a67493e5d5923d41c111fbd4bb45ce365de9f152

Contents?: true

Size: 347 Bytes

Versions: 6

Compression:

Stored size: 347 Bytes

Contents

module Delayed::ShallowMongoid
  class DocumentStub < Struct.new(:klass, :id, :selector)
    def description
      "#{klass}[#{id}]".tap do |desc|
        desc << "." + selector.map{ |s|
          s.is_a?(Array) ? "#{s.first}(#{s[1..-1].map(&:inspect).join(', ')})" : s
        }.join(".") if selector && selector.any?
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
delayed_job_shallow_mongoid-0.5.1 lib/delayed/shallow_mongoid/document_stub.rb
delayed_job_shallow_mongoid-0.5.0 lib/delayed/shallow_mongoid/document_stub.rb
delayed_job_shallow_mongoid-0.4.0 lib/delayed/shallow_mongoid/document_stub.rb
delayed_job_shallow_mongoid-0.3.0 lib/delayed/shallow_mongoid/document_stub.rb
delayed_job_shallow_mongoid-0.2.8 lib/delayed/shallow_mongoid/document_stub.rb
delayed_job_shallow_mongoid-0.2.7 lib/delayed/shallow_mongoid/document_stub.rb