Class: ZendeskAPI::Macro

Inherits:
Rule show all
Includes:
Actions
Defined in:
lib/zendesk_api/resources.rb

Instance Method Summary collapse

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

#add_action(field, value) ⇒ Object Originally defined in module Actions

#apply(ticket = nil) ⇒ Object

Returns the update to a ticket that happens when a macro will be applied.

Parameters:

  • ticket (Ticket) (defaults to: nil)

    Optional Ticket to apply this macro to



629
630
631
632
633
# File 'lib/zendesk_api/resources.rb', line 629

def apply(ticket = nil)
  apply!(ticket)
rescue Faraday::Error::ClientError
  SilentMash.new
end

#apply!(ticket = nil) ⇒ Object

Returns the update to a ticket that happens when a macro will be applied.

Parameters:

  • ticket (Ticket) (defaults to: nil)

    Optional Ticket to apply this macro to.

Raises:

  • (Faraday::Error::ClientError)

    Raised for any non-200 response.



616
617
618
619
620
621
622
623
624
625
# File 'lib/zendesk_api/resources.rb', line 616

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

#executionZendeskAPI::RuleExecution

Returns The associated object

Returns:



611
# File 'lib/zendesk_api/resources.rb', line 611

has :execution, :class => RuleExecution

#execution=(value) ⇒ ZendeskAPI::RuleExecution

Returns The associated object

Parameters:

Returns:



611
# File 'lib/zendesk_api/resources.rb', line 611

has :execution, :class => RuleExecution