Module: ZendeskAPI::Tag::Update

Defined in:
lib/zendesk_api/resources.rb

Instance Method Summary collapse

Instance Method Details

#_save(method = :save) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/zendesk_api/resources.rb', line 57

def _save(method = :save)
  return self unless @resources

  @client.connection.post(path) do |req|
    req.body = { :tags => @resources.reject(&:destroyed?).map(&:id) }
  end

  true
rescue Faraday::Error::ClientError => e
  if method == :save
    false
  else
    raise e
  end
end