Module: Riik::Document::Finders::ClassMethods

Defined in:
lib/riik/document/finders.rb

Instance Method Summary collapse

Instance Method Details

#find(key) ⇒ Object

Find an object by key.

Returns:

  • (Object)

    instance of the object, if found, else nil.



17
18
19
20
21
22
23
24
25
# File 'lib/riik/document/finders.rb', line 17

def find(key)
  if robject = get(key)
    self.new(robject.data).tap do |object|
      object.robject = robject
    end
  else
    nil
  end
end