Sha256: 8ea38f435324bea43063f54b53e44b45bc371034f8cbed6633c62bb99f08620c

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

module RockRMS
  class Client
    module Batch
      def list_batches(options = {})
        get(batches_path, options)
      end

      def find_batch(id)
        get(batches_path(id))
      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 = {})
        patch(batches_path(id), options)
      end

      private

      def batches_path(id = nil)
        id ? "FinancialBatches/#{id}" : 'FinancialBatches'
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rock_rms-1.2.0 lib/rock_rms/resources/batch.rb
rock_rms-1.1.0 lib/rock_rms/resources/batch.rb
rock_rms-1.0.1 lib/rock_rms/resources/batch.rb
rock_rms-1.0.0 lib/rock_rms/resources/batch.rb
rock_rms-0.0.10 lib/rock_rms/resources/batch.rb
rock_rms-0.0.9 lib/rock_rms/resources/batch.rb