Module: ProsperWorks::ApiOperations::Update

Includes:
Connect
Included in:
BaseEntity
Defined in:
lib/prosperworks/api_operations/update.rb

Instance Method Summary collapse

Methods included from Connect

#get_uri, #handle_response, #send_request

Instance Method Details

#update(entity, attributes = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/prosperworks/api_operations/update.rb', line 9

def update(entity ,attributes = {})
  entity.set_attributes(attributes)
  id = entity.id

  uri = get_uri(api_name, id)

  response = send_request("put", uri, entity)
  handle_response(self.new, response)
end