Module: RedboothRuby::Operations::Update::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#update(attributes = {}) ⇒ Object

Updates a object

Parameters:

  • id (Integer)

    The id of the object that should be updated

  • attributes (Hash) (defaults to: {})

    The attributes that should be updated



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

def update(attributes = {})
  id = attributes.delete(:id)
  session = attributes.delete(:session)
  response = RedboothRuby.request(:put,
                                  nil,
                                  api_member_url(id, :updated),
                                  attributes,
                                  options_for_request(session: session)
                                 )
  new(response.data)
end