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
Class Method Summary collapse
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
#==, #account_data, #attributes_for_save, #id, inherited, #initialize, #inspect, #loaded_associations, #method_missing, namespace, new_from_response, #new_record?, #path, #refresh_custom_fields_metadata, resource_name, resource_path, #respond_to_missing?, 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
Class Method Details
.cbp_path_regexes ⇒ Object
771 772 773 |
# File 'lib/zendesk_api/resources.rb', line 771 def self.cbp_path_regexes [/^macros$/] end |
Instance Method Details
#apply(ticket = nil) ⇒ Object
Returns the update to a ticket that happens when a macro will be applied.
791 792 793 794 795 |
# File 'lib/zendesk_api/resources.rb', line 791 def apply(ticket = nil) apply!(ticket) rescue Faraday::ClientError SilentMash.new end |
#apply!(ticket = nil) ⇒ Object
Returns the update to a ticket that happens when a macro will be applied.
778 779 780 781 782 783 784 785 786 787 |
# File 'lib/zendesk_api/resources.rb', line 778 def apply!(ticket = nil) path = "#{self.path}/apply" if ticket path = "#{ticket.path}/#{path}" end response = @client.connection.get(path) SilentMash.new(response.body.fetch("result", {})) end |