Class: Mintchip::Hosted::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/mintchip/hosted/info.rb

Constant Summary collapse

ATTRIBUTES =
%w(id currencyCode balance creditLogCount debitLogCount) +
%w(creditLogCountRemaining debitLogCountRemaining maxCreditAllowed maxDebitAllowed version)

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Info

Returns a new instance of Info.



9
10
11
12
13
14
# File 'lib/mintchip/hosted/info.rb', line 9

def initialize(str)
  attrs = JSON.parse(str)
  ATTRIBUTES.each do |attr|
    instance_variable_set("@#{attr.underscore}", attrs[attr])
  end
end