Class: AtlasRb::FileSet
Constant Summary collapse
- ROUTE =
"/file_sets/"
Class Method Summary collapse
- .create(id, classification) ⇒ Object
- .destroy(id) ⇒ Object
- .find(id) ⇒ Object
- .update(id, blob_path) ⇒ Object
Methods inherited from Resource
Methods included from FaradayHelper
Class Method Details
.create(id, classification) ⇒ Object
11 12 13 |
# File 'lib/atlas_rb/file_set.rb', line 11 def self.create(id, classification) connection({ work_id: id, classification: classification }).post(ROUTE)&.body end |
.destroy(id) ⇒ Object
15 16 17 |
# File 'lib/atlas_rb/file_set.rb', line 15 def self.destroy(id) connection({}).delete(ROUTE + id) end |
.find(id) ⇒ Object
7 8 9 |
# File 'lib/atlas_rb/file_set.rb', line 7 def self.find(id) connection({}).get(ROUTE + id)&.body end |
.update(id, blob_path) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/atlas_rb/file_set.rb', line 19 def self.update(id, blob_path) # Need to figure out blob vs XML payload = { binary: Faraday::Multipart::FilePart.new(File.open(blob_path), "application/octet-stream", File.basename(blob_path)) } multipart({}).patch(ROUTE + id, payload)&.body end |