Sha256: 210a0fd30e5398b46a44d6f8b8dd5f9f3bc0716e2ad7568be26152ae88d10f93
Contents?: true
Size: 943 Bytes
Versions: 5
Compression:
Stored size: 943 Bytes
Contents
module RockRMS class Client module Batch def list_batches(options = {}) res = get(batches_path, options) Response::Batch.format(res) end def find_batch(id) res = get(batches_path(id)) Response::Batch.format(res) end def create_batch(name:, start_time:, end_time:, foreign_key: nil) options = { 'Name' => name, 'BatchStartDateTime' => start_time, 'BatchEndDateTime' => end_time, 'ForeignKey' => foreign_key } post(batches_path, options) end def update_batch(id, options = {}) options = options.collect { |k, v| [k.to_s, v] }.to_h patch(batches_path(id), options) end def delete_batch(id) delete(batches_path(id)) end private def batches_path(id = nil) id ? "FinancialBatches/#{id}" : 'FinancialBatches' end end end end
Version data entries
5 entries across 5 versions & 1 rubygems