Sha256: f79ebc42d73a43f9eded65ac0ab6b982341c30218a5632d621e5dc5161365259
Contents?: true
Size: 1.22 KB
Versions: 15
Compression:
Stored size: 1.22 KB
Contents
module Myfinance module Resources class SaleRule < Base def find_all(sale_account_id) http.get("/sale_accounts/#{sale_account_id}/rules", body: {}) do |response| respond_with_collection(response) end end def find(sale_account_id, rule_id) path = "/sale_accounts/#{sale_account_id}/rules/#{rule_id}" http.get(path, body: {}) do |response| respond_with_object(response, "sale_rule") end end def create(sale_account_id, params = {}) path = "/sale_accounts/#{sale_account_id}/rules/" http.post(path, body: { sale_rule: params }) do |response| respond_with_object(response, "sale_rule") end end def update(sale_account_id, rule_id, params = {}) path = "/sale_accounts/#{sale_account_id}/rules/#{rule_id}" http.put(path, body: { sale_rule: params }) do |response| respond_with_object(response, "sale_rule") end end def destroy(sale_account_id, rule_id, params = {}) path = "/sale_accounts/#{sale_account_id}/rules/#{rule_id}" http.delete(path, body: { sale_rule: params }) do |response| response end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems