Class: Delayed::ShallowMongoid::DocumentStub

Inherits:
Struct
  • Object
show all
Defined in:
lib/delayed/shallow_mongoid/document_stub.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



3
4
5
# File 'lib/delayed/shallow_mongoid/document_stub.rb', line 3

def id
  @id
end

#klassObject

Returns the value of attribute klass

Returns:

  • (Object)

    the current value of klass



3
4
5
# File 'lib/delayed/shallow_mongoid/document_stub.rb', line 3

def klass
  @klass
end

#selectorObject

Returns the value of attribute selector

Returns:

  • (Object)

    the current value of selector



3
4
5
# File 'lib/delayed/shallow_mongoid/document_stub.rb', line 3

def selector
  @selector
end

Instance Method Details

#descriptionObject



4
5
6
7
8
9
10
# File 'lib/delayed/shallow_mongoid/document_stub.rb', line 4

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