Class: PlateApi::PlateObject::Attachment

Inherits:
Base
  • Object
show all
Defined in:
lib/plate_api/plate_object/attachment.rb

Constant Summary

Constants inherited from Base

Base::HasManyRelations, Base::HasOneRelations

Instance Attribute Summary

Attributes inherited from Base

#attributes, #id, #object_handler, #relations

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #api_name, #delete, #initialize, #inspect, #method_missing, #reload, #respond_to_missing?, #to_s, #update

Constructor Details

This class inherits a constructor from PlateApi::PlateObject::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PlateApi::PlateObject::Base

Class Method Details

.api_nameObject



11
12
13
# File 'lib/plate_api/plate_object/attachment.rb', line 11

def self.api_name
  "attachments"
end

.parent_classObject



15
16
17
# File 'lib/plate_api/plate_object/attachment.rb', line 15

def self.parent_class
  Site
end

Instance Method Details

#downloadObject



7
8
9
# File 'lib/plate_api/plate_object/attachment.rb', line 7

def download
  @object_handler.api_connector.get("attachments/#{@id}/download", {}, :raw)
end