Sha256: a2f1eb130df290fb5324fa47ffebd6c714784fffb3f52c64ffeb0d0f04f59f1f

Contents?: true

Size: 458 Bytes

Versions: 16

Compression:

Stored size: 458 Bytes

Contents

module TrackerApi
  module Endpoints
    class FileAttachment
      attr_accessor :client

      def initialize(client)
        @client = client
      end

      def create(project_id, file_name, content_type)
        body = {file: Faraday::UploadIO.new(file_name, content_type)}
        data = client.post("/projects/#{project_id}/uploads", body: body).body
        Resources::FileAttachment.new({ client: client }.merge(data))
      end

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
v2gpti-1.3.5 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.3.4 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.3.3 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.3.2 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.3.1 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.3.0 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.9 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.8 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.7 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.6 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.5 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.4 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.3 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.2 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.1 tracker_api/lib/tracker_api/endpoints/file_attachment.rb
v2gpti-1.2.0 tracker_api/lib/tracker_api/endpoints/file_attachment.rb