Module: Riik::Document::Persistence::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#create(attributes = {}) ⇒ Object

Create a new object from provided attributes.

Returns:

  • (Object)

    instance of created object.



18
19
20
21
22
# File 'lib/riik/document/persistence.rb', line 18

def create(attributes = {})
  self.new(attributes).tap do |object|
    object.save
  end
end