Method: Frodo::Concerns::API#create
- Defined in:
- lib/frodo/concerns/api.rb
#create(*args) ⇒ Object Also known as: insert
Public: Insert a new record.
entity_set - The set the entity belongs to attrs - Hash of attributes to set on the new record.
Examples
# Add a new lead
client.create('leads', {"firstname" =>'Bob'})
# => '073ca9c8-2a41-e911-a81d-000d3a1d5a0b'
Returns the primary key value of the newly created entity. Returns false if something bad happens.
91 92 93 94 95 |
# File 'lib/frodo/concerns/api.rb', line 91 def create(*args) create!(*args) rescue *exceptions false end |