Method: Clouder::Entity.create

Defined in:
lib/clouder/entity.rb

.create(hsh = {}) ⇒ Object

Creates and saves an object with the attributes and values passed as a hash. Returns the newly created object.

note = Note.create(:text => "My note", :author => "John Doe")


51
52
53
54
55
# File 'lib/clouder/entity.rb', line 51

def create(hsh = {})
  obj = self.new(hsh || {})
  obj.save   
  obj
end