Sha256: 11f74b3960fc77caaf898fcdc177ee17179f016f5fcd1f5a841ba9ea7c889441
Contents?: true
Size: 926 Bytes
Versions: 29
Compression:
Stored size: 926 Bytes
Contents
# frozen_string_literal: true module AtlasRb class File < Resource ROUTE = "/files/" end def self.find(id) connection({}).get(ROUTE + id)&.body end def self.create(id, blob_path) payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path), "application/octet-stream", File.basename(blob_path)) } multipart({ work_id: id }).post(ROUTE, payload)&.body end def self.destroy(id) connection({}).delete(ROUTE + id) end def self.update(id, blob_path) payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path), "application/octet-stream", File.basename(blob_path)) } multipart({}).patch(ROUTE + id, payload)&.body end end
Version data entries
29 entries across 29 versions & 1 rubygems