Class: ZendeskAPI::Attachment
- Inherits:
-
ReadResource
- Object
- Data
- DataResource
- ReadResource
- ZendeskAPI::Attachment
- Defined in:
- lib/zendesk_api/resources.rb
Instance Attribute Summary
Attributes inherited from DataResource
Attributes inherited from Data
#association, #attributes, #errors, #response
Instance Method Summary collapse
-
#initialize(client, attributes = {}) ⇒ Attachment
constructor
A new instance of Attachment.
- #save ⇒ Object
- #to_param ⇒ Object
Methods included from Read
Methods included from Sideloading
Methods included from ResponseHandler
Methods inherited from DataResource
Methods included from Verbs
Methods inherited from Data
#==, #attributes_for_save, #id, inherited, #loaded_associations, #method_missing, namespace, new_from_response, #new_record?, #path, resource_name, resource_path, #respond_to_missing?, singular_resource_name, subclasses, #to_json, #to_s
Methods included from Associations
Constructor Details
#initialize(client, attributes = {}) ⇒ Attachment
Returns a new instance of Attachment.
149 150 151 152 153 |
# File 'lib/zendesk_api/resources.rb', line 149 def initialize(client, attributes = {}) attributes[:file] ||= attributes.delete(:id) super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ZendeskAPI::Data
Instance Method Details
#save ⇒ Object
155 156 157 158 |
# File 'lib/zendesk_api/resources.rb', line 155 def save upload = Upload.create!(@client, attributes) self.token = upload.token end |
#to_param ⇒ Object
160 161 162 |
# File 'lib/zendesk_api/resources.rb', line 160 def to_param token end |