Sha256: 886b4eff711ad25600b21cada48b18fa1c2d4cd3d6615cc2a2f504cc990d8960
Contents?: true
Size: 1.1 KB
Versions: 16
Compression:
Stored size: 1.1 KB
Contents
module Myfinance module Resources class Sale < Base def find_all(entity_id) http.get("/entities/#{entity_id}/sales", body: {}) do |response| respond_with_collection(response) end end def find(entity_id, sale_id) path = "/entities/#{entity_id}/sales/#{sale_id}" http.get(path, body: {}) do |response| respond_with_object(response, "sale") end end def create(entity_id, params = {}) path = "/entities/#{entity_id}/sales/" http.post(path, body: { sale: params }) do |response| respond_with_object(response, "sale") end end def update(entity_id, sale_id, params = {}) path = "/entities/#{entity_id}/sales/#{sale_id}" http.put(path, body: { sale: params }) do |response| respond_with_object(response, "sale") end end def destroy(entity_id, sale_id, params = {}) path = "/entities/#{entity_id}/sales/#{sale_id}" http.delete(path, body: { sale: params }) do |response| response end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems