class ZendeskAPI::Setting

Attributes

on[R]

Public Class Methods

new(client, attributes = {}) click to toggle source
Calls superclass method ZendeskAPI::Data::new
# File lib/zendesk_api/resources.rb, line 299
def initialize(client, attributes = {})
  # Try and find the root key
  @on = (attributes.keys.map(&:to_s) - %w{association options}).first

  # Make what's inside that key the root attributes
  attributes.merge!(attributes.delete(@on))

  super
end

Public Instance Methods

attributes_for_save() click to toggle source
# File lib/zendesk_api/resources.rb, line 317
def attributes_for_save
  { self.class.resource_name => { @on => attributes.changes } }
end
new_record?() click to toggle source
# File lib/zendesk_api/resources.rb, line 309
def new_record?
  false
end
path(options = {}) click to toggle source
Calls superclass method ZendeskAPI::Data#path
# File lib/zendesk_api/resources.rb, line 313
def path(options = {})
  super(options.merge(:with_parent => true))
end