Sha256: 9d21fdfeb6234ba3b415af6942403db07c3095982ba60f07501d67a464aa4fb1
Contents?: true
Size: 748 Bytes
Versions: 1
Compression:
Stored size: 748 Bytes
Contents
# frozen_string_literal: true module AtlasRb class Work < Resource ROUTE = "/works/" def self.find(id) JSON.parse(connection({}).get(ROUTE + id)&.body) end def self.create(id) # params[:collection_id] JSON.parse(connection({ collection_id: id }).post(ROUTE)&.body) end def self.destroy(id) connection({}).delete(ROUTE + id) end def self.update(id, xml_path) payload = { binary: Faraday::Multipart::FilePart.new(File.open(xml_path), "application/xml", File.basename(xml_path)) } JSON.parse(multipart({}).patch(ROUTE + id, payload)&.body) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
atlas_rb-0.0.29 | lib/atlas_rb/work.rb |