Class: ZendeskAPI::Attachment

Inherits:
Data
  • Object
show all
Defined in:
lib/zendesk_api/resources.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

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 Attribute Details

- (ZendeskAPI::Association) association Originally defined in class Data

The association

Returns:

  • (ZendeskAPI::Association)

    The association

- (Hash) attributes (readonly) Also known as: to_param Originally defined in class Data

The resource's attributes

Returns:

  • (Hash)

    The resource's attributes

- (Array) errors Originally defined in class Data

The last received errors

Returns:

  • (Array)

    The last received errors

- (Object) response Originally defined in class Data

Place to dump the last response

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