Class: AlephApi::RestfulApiClient::Patron::CirculationActions::Cash

Inherits:
Object
  • Object
show all
Defined in:
lib/aleph_api/restful_api_client/patron/circulation_actions/cash.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, patron_id, cash_id = nil) ⇒ Cash

Returns a new instance of Cash.



4
5
6
7
8
# File 'lib/aleph_api/restful_api_client/patron/circulation_actions/cash.rb', line 4

def initialize(client, patron_id, cash_id = nil)
  @client = client
  @cash_id = cash_id
  @patron_id = patron_id
end

Instance Method Details

#get(options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/aleph_api/restful_api_client/patron/circulation_actions/cash.rb', line 10

def get(options = {})
  if @cash_id
    @client.http(:get, "/patron/#{@patron_id}/circulationActions/cash/#{@cash_id}", options).try do |_response|
      _response.body
    end
  else
    @client.http(:get, "/patron/#{@patron_id}/circulationActions/cash", options).try do |_response|
      _response.body
    end
  end
end