Class: Trolley::BalanceGateway

Inherits:
Object
  • Object
show all
Defined in:
lib/trolley/gateways/BalanceGateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ BalanceGateway

Returns a new instance of BalanceGateway.



5
6
7
# File 'lib/trolley/gateways/BalanceGateway.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#find(term = '') ⇒ Object



9
10
11
12
# File 'lib/trolley/gateways/BalanceGateway.rb', line 9

def find(term = '')
  response = @client.get("/v1/balances/#{term}" )
  JSON.parse(response,  object_class: OpenStruct)
end