Class: Delayed::ShallowMongoid::DocumentStub
- Inherits:
-
Struct
- Object
- Struct
- Delayed::ShallowMongoid::DocumentStub
- Defined in:
- lib/delayed/shallow_mongoid/document_stub.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#selector ⇒ Object
Returns the value of attribute selector.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
3 4 5 |
# File 'lib/delayed/shallow_mongoid/document_stub.rb', line 3 def id @id end |
#klass ⇒ Object
Returns the value of attribute klass
3 4 5 |
# File 'lib/delayed/shallow_mongoid/document_stub.rb', line 3 def klass @klass end |
#selector ⇒ Object
Returns the value of attribute selector
3 4 5 |
# File 'lib/delayed/shallow_mongoid/document_stub.rb', line 3 def selector @selector end |
Instance Method Details
#description ⇒ Object
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 |