Class: Platforms::Yammer::Api::PendingAttachments

Inherits:
Base
  • Object
show all
Defined in:
lib/platforms/yammer/api/pending_attachments.rb

Overview

Pending attachments in Yammer

Since:

  • 0.1.0

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Platforms::Yammer::Api::Base

Instance Method Details

#delete(id, options = {}, headers = {}) ⇒ Faraday::Response

Delete a pending attachment

Parameters:

  • id (#to_s)

    ID of pending attachment to delete

  • options (Hash) (defaults to: {})

    Options for the request

  • headers (Hash) (defaults to: {})

    Additional headers to send with the request

Returns:

  • (Faraday::Response)

    the API response

See Also:

Since:

  • 0.1.0



27
28
29
# File 'lib/platforms/yammer/api/pending_attachments.rb', line 27

def delete id, options={}, headers={}
  @connection.delete "pending_attachments/#{id}.json", options, headers
end

#post(upload_io, options = {}, headers = {}) ⇒ Faraday::Response

Add a pending attachment

Parameters:

  • upload_io (Faraday::UploadIO)

    The file payload

  • options (Hash) (defaults to: {})

    Additional options for the request

  • headers (Hash) (defaults to: {})

    Additional headers to send with the request

Returns:

  • (Faraday::Response)

    the API response

See Also:

Since:

  • 0.1.0



16
17
18
19
# File 'lib/platforms/yammer/api/pending_attachments.rb', line 16

def post upload_io, options={}, headers={}
  body = { file: upload_io }.reverse_merge(options)
  @connection.post 'pending_attachments.json', body, headers
end