Method: ZendeskAPI::Setting#initialize

Defined in:
lib/zendesk_api/resources.rb

#initialize(client, attributes = {}) ⇒ Setting

Returns a new instance of Setting.



275
276
277
278
279
280
281
282
283
# File 'lib/zendesk_api/resources.rb', line 275

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