Class: Clearbooks::Ledger
Overview
Instance Attribute Summary collapse
-
#account ⇒ String
readonly
Optional.
-
#amount ⇒ BigDecimal
readonly
Optional.
Instance Method Summary collapse
-
#initialize(data) ⇒ Ledger
constructor
A new instance of Ledger.
-
#to_savon ⇒ Hash
Returns self as Savon readable Hash.
Methods inherited from Base
Constructor Details
#initialize(data) ⇒ Ledger
Returns a new instance of Ledger.
30 31 32 33 |
# File 'lib/clearbooks/model/ledger.rb', line 30 def initialize data @account = data.savon :account @amount = BigDecimal.new data.savon :amount end |
Instance Attribute Details
#account ⇒ String (readonly)
Optional. Account code for associated transaction.
16 17 18 |
# File 'lib/clearbooks/model/ledger.rb', line 16 def account @account end |
#amount ⇒ BigDecimal (readonly)
Optional. Amount for associated transaction in the journal.
21 22 23 |
# File 'lib/clearbooks/model/ledger.rb', line 21 def amount @amount end |
Instance Method Details
#to_savon ⇒ Hash
Returns self as Savon readable Hash
39 40 41 42 43 44 45 46 |
# File 'lib/clearbooks/model/ledger.rb', line 39 def to_savon { ledger: { :@account => @account, :@amount => @amount.to_f }.compact } end |