Module: ZendeskAPI::Update::ClassMethod
- Defined in:
- lib/zendesk_api/actions.rb
Instance Method Summary collapse
-
#update(client, attributes = {}) ⇒ Object
Updates, returning false on error.
-
#update!(client, attributes = {}) ⇒ Object
Updates a resource given the id passed in.
Instance Method Details
#update(client, attributes = {}) ⇒ Object
Updates, returning false on error.
292 293 294 295 296 |
# File 'lib/zendesk_api/actions.rb', line 292 def update(client, attributes = {}, &) update!(client, attributes, &) rescue ZendeskAPI::Error::ClientError false end |
#update!(client, attributes = {}) ⇒ Object
Updates a resource given the id passed in.
301 302 303 304 305 306 307 |
# File 'lib/zendesk_api/actions.rb', line 301 def update!(client, attributes = {}, &) ZendeskAPI::Client.check_deprecated_namespace_usage attributes, singular_resource_name resource = new(client, id: attributes.delete(:id), global: attributes.delete(:global), association: attributes.delete(:association)) resource.attributes.merge!(attributes) resource.save!(force_update: resource.is_a?(SingularResource), &) resource end |