Class: Roqua::CoreApi::UpdatePerson Private

Inherits:
Base
  • Object
show all
Defined in:
lib/roqua/core_api/update_person.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#executeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Saves the person attributes to server. Returns true on success, false on validation errors. Adds errors to person object based on I18n errors.messages. Raises on other errors.



12
13
14
15
16
17
18
19
20
# File 'lib/roqua/core_api/update_person.rb', line 12

def execute
  response = session.patch "/people/#{person.id}", person: person.serializable_hash
  if response.code == 422
    errors_to_object(response, person)
    false
  else
    true
  end
end