Class: KashflowApi::CustomerBalance
- Inherits:
-
Object
- Object
- KashflowApi::CustomerBalance
- Defined in:
- lib/kashflow_api/models/customer_balance.rb
Instance Attribute Summary collapse
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(customer) ⇒ CustomerBalance
constructor
A new instance of CustomerBalance.
Constructor Details
#initialize(customer) ⇒ CustomerBalance
Returns a new instance of CustomerBalance.
5 6 7 8 9 10 |
# File 'lib/kashflow_api/models/customer_balance.rb', line 5 def initialize(customer) result = KashflowApi.api.get_customer_balance(customer.code) @customer = customer @value = result.basic_hash["soap:Envelope"]["soap:Body"]["GetCustomerBalanceResponse"]["GetCustomerBalanceResult"]["Value"].to_f @balance = result.basic_hash["soap:Envelope"]["soap:Body"]["GetCustomerBalanceResponse"]["GetCustomerBalanceResult"]["Balance"].to_f end |
Instance Attribute Details
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
3 4 5 |
# File 'lib/kashflow_api/models/customer_balance.rb', line 3 def balance @balance end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
3 4 5 |
# File 'lib/kashflow_api/models/customer_balance.rb', line 3 def customer @customer end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/kashflow_api/models/customer_balance.rb', line 3 def value @value end |