Class: Subledger::Interface::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/subledger/interface/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Client

Returns a new instance of Client.



245
246
247
248
249
250
251
# File 'lib/subledger/interface/client.rb', line 245

def initialize args
  @client_args = args

  # TODO client should not have @store and #store

  @store = args[:store]
end

Instance Attribute Details

#storeObject (readonly)

Returns the value of attribute store.



243
244
245
# File 'lib/subledger/interface/client.rb', line 243

def store
  @store
end

Instance Method Details

#balance(*args) ⇒ Object



290
291
292
# File 'lib/subledger/interface/client.rb', line 290

def balance *args
  Domain::Balance.new *args
end

#credit(*args) ⇒ Object



282
283
284
# File 'lib/subledger/interface/client.rb', line 282

def credit *args
  args.empty? ? Domain::Credit : Domain::Credit.new( *args )
end

#debit(*args) ⇒ Object



278
279
280
# File 'lib/subledger/interface/client.rb', line 278

def debit *args
  args.empty? ? Domain::Debit  : Domain::Debit.new( *args )
end

#zero(*args) ⇒ Object



286
287
288
# File 'lib/subledger/interface/client.rb', line 286

def zero *args
  Domain::Zero.new
end