Class: ZendeskAPI::Tag

Inherits:
DataResource show all
Includes:
Destroy, Update
Defined in:
lib/zendesk_api/resources.rb

Defined Under Namespace

Modules: Update

Instance Attribute Summary

Attributes inherited from DataResource

#error, #error_message

Attributes inherited from Data

#association, #attributes, #errors, #response

Instance Method Summary collapse

Methods included from Destroy

#destroy, #destroyed?, included

Methods included from Update

included

Methods included from Save

#clear_associations, #save, #save!, #save_associations

Methods included from ResponseHandler

#handle_response

Methods included from Verbs

#any, #delete, #post, #put

Methods inherited from Data

#==, #id, inherited, #initialize, #loaded_associations, #method_missing, namespace, new_from_response, #new_record?, resource_name, resource_path, #respond_to_missing?, singular_resource_name, subclasses, #to_json, #to_s

Methods included from Associations

included, #wrap_resource

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

#attributes_for_saveObject



81
82
83
# File 'lib/zendesk_api/resources.rb', line 81

def attributes_for_save
  { self.class.resource_name => [id] }
end

#changed?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/zendesk_api/resources.rb', line 53

def changed?
  true
end

#destroy!Object



57
58
59
60
61
# File 'lib/zendesk_api/resources.rb', line 57

def destroy!
  super do |req|
    req.body = attributes_for_save
  end
end

#path(opts = {}) ⇒ Object



48
49
50
51
# File 'lib/zendesk_api/resources.rb', line 48

def path(opts = {})
  raise "tags must have parent resource" unless association.options.parent
  super(opts.merge(:with_parent => true, :with_id => false))
end