Class: ZendeskAPI::Attachment
Instance Attribute Summary
Attributes inherited from Data
#association, #attributes, #response
Instance Method Summary (collapse)
-
- (Attachment) initialize(client, attributes)
constructor
A new instance of Attachment.
- - (Object) save
- - (Object) to_param
Methods inherited from Data
#/, #==, format, #id, #method_missing, #new_record?, #path, resource_name, singular_resource_name, subclasses, #to_json
Constructor Details
- (Attachment) initialize(client, attributes)
A new instance of Attachment
31 32 33 34 35 36 37 |
# File 'lib/zendesk_api/resources.rb', line 31 def initialize(client, attributes) if attributes.is_a?(Hash) super else super(client, :file => attributes) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ZendeskAPI::Data
Instance Method Details
- (Object) save
39 40 41 42 |
# File 'lib/zendesk_api/resources.rb', line 39 def save upload = Upload.create!(@client, attributes) self.token = upload.token end |
- (Object) to_param
44 45 46 |
# File 'lib/zendesk_api/resources.rb', line 44 def to_param token end |