Module: RedboothRuby::Operations::Create::ClassMethods

Defined in:
lib/redbooth-ruby/operations/create.rb

Instance Method Summary collapse

Instance Method Details

#create(attributes) ⇒ Object

Creates a new object

Parameters:

  • attributes (Hash)

    The attributes of the created object



8
9
10
11
12
13
14
15
16
17
# File 'lib/redbooth-ruby/operations/create.rb', line 8

def create(attributes)
  session = attributes.delete(:session)
  response = RedboothRuby.request(:post,
                                  nil,
                                  api_collection_url(attributes),
                                  attributes,
                                  options_for_request(session: session)
                                 )
  new(response.data.merge(session: session))
end