Class: FastBound::Attachment

Inherits:
Base
  • Object
show all
Includes:
API
Defined in:
lib/fastbound-ruby/attachment.rb

Constant Summary collapse

ENDPOINTS =
{
  download: "attachments/download/%s".freeze,
}

Constants included from API

FastBound::API::FILE_UPLOAD_ATTRS, FastBound::API::ROOT_URL, FastBound::API::USER_AGENT

Instance Method Summary collapse

Methods included from API

#delete_request, #get_request, #post_file_request, #post_request, #put_request

Constructor Details

#initialize(client) ⇒ Attachment

Returns a new instance of Attachment.



12
13
14
# File 'lib/fastbound-ruby/attachment.rb', line 12

def initialize(client)
  @client = client
end

Instance Method Details

#download(attachment_id) ⇒ Object



16
17
18
19
20
# File 'lib/fastbound-ruby/attachment.rb', line 16

def download(attachment_id)
  endpoint = ENDPOINTS[:download] % attachment_id

  get_request(@client, endpoint)
end