Class: ZendeskAPI::Macro
- Includes:
- Actions
- Defined in:
- lib/zendesk_api/resources.rb
Instance Attribute Summary
Attributes inherited from DataResource
Attributes inherited from Data
#association, #attributes, #errors, #response
Instance Method Summary collapse
-
#apply(ticket = nil) ⇒ Object
Returns the update to a ticket that happens when a macro will be applied.
-
#apply!(ticket = nil) ⇒ Object
Returns the update to a ticket that happens when a macro will be applied.
Methods included from Actions
Methods included from Destroy
#destroy, #destroy!, #destroyed?, included
Methods included from Update
Methods included from Save
#clear_associations, #save, #save!, #save_associations
Methods included from ResponseHandler
Methods included from Create
Methods included from Read
Methods included from Sideloading
Methods included from Verbs
Methods inherited from Data
#==, #id, inherited, #initialize, #loaded_associations, #method_missing, namespace, new_from_response, #new_record?, #path, resource_name, resource_path, singular_resource_name, subclasses, #to_json, #to_s
Methods included from Associations
Constructor Details
This class inherits a constructor from ZendeskAPI::Data
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ZendeskAPI::Data
Instance Method Details
#apply(ticket = nil) ⇒ Object
Returns the update to a ticket that happens when a macro will be applied.
618 619 620 621 622 |
# File 'lib/zendesk_api/resources.rb', line 618 def apply(ticket = nil) apply!(ticket) rescue Faraday::Error::ClientError => e Hashie::Mash.new end |
#apply!(ticket = nil) ⇒ Object
Returns the update to a ticket that happens when a macro will be applied.
605 606 607 608 609 610 611 612 613 614 |
# File 'lib/zendesk_api/resources.rb', line 605 def apply!(ticket = nil) path = "#{self.path}/apply" if ticket path = "#{ticket.path}/#{path}" end response = @client.connection.get(path) Hashie::Mash.new(response.body.fetch("result", {})) end |