Module: Copy::Operations::Update::ClassMethods

Defined in:
lib/copy/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
# File 'lib/copy/operations/update.rb', line 8

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