Class: ZendeskAPI::Attachment
- Defined in:
- lib/zendesk_api/resources/misc.rb
Instance Attribute Summary
Attributes inherited from Data
Instance Method Summary collapse
-
#initialize(client, attributes) ⇒ Attachment
constructor
A new instance of Attachment.
- #save ⇒ Object
- #to_param ⇒ Object
Methods inherited from Data
#==, #id, #method_missing, #new_record?, only_send_unnested_params, #path, resource_name, singular_resource_name, #to_s, unnested_params
Methods included from Associations
Constructor Details
#initialize(client, attributes) ⇒ Attachment
Returns a new instance of Attachment.
28 29 30 31 32 33 34 |
# File 'lib/zendesk_api/resources/misc.rb', line 28 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
#save ⇒ Object
36 37 38 39 |
# File 'lib/zendesk_api/resources/misc.rb', line 36 def save upload = Upload.create!(@client, attributes) self.token = upload.token end |
#to_param ⇒ Object
41 42 43 |
# File 'lib/zendesk_api/resources/misc.rb', line 41 def to_param token end |