Class: ZendeskAPI::Attachment
Instance Attribute Summary
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 inherited from Data
#==, #id, inherited, #loaded_associations, #method_missing, namespace, new_from_response, #new_record?, #path, resource_name, resource_path, singular_resource_name, subclasses, #to_json, #to_s
Methods included from Associations
Constructor Details
#initialize(client, attributes) ⇒ Attachment
Returns a new instance of Attachment.
80 81 82 83 84 |
# File 'lib/zendesk_api/resources.rb', line 80 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
86 87 88 89 |
# File 'lib/zendesk_api/resources.rb', line 86 def save upload = Upload.create!(@client, attributes) self.token = upload.token end |
#to_param ⇒ Object
91 92 93 |
# File 'lib/zendesk_api/resources.rb', line 91 def to_param token end |