Class: Rubyplat::Responses::CheckBalanceResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/rubyplat/responses/check_balance_response.rb

Instance Method Summary collapse

Methods inherited from Response

from_response_string, #initialize

Methods included from Utils::Parser

#parse

Constructor Details

This class inherits a constructor from Rubyplat::Responses::Response

Instance Method Details

#available_limitFloat

current amount of available funds for client.

Returns:

  • (Float)

    REST_WO_LIMIT



17
18
19
# File 'lib/rubyplat/responses/check_balance_response.rb', line 17

def available_limit
  Float(@rest_wo_limit)
end

#daily_limitFloat?

amount of daily available funds

Returns:

  • (Float)

    AP_DAILY_LIMIT if set

  • (nil)

    if not set



24
25
26
# File 'lib/rubyplat/responses/check_balance_response.rb', line 24

def daily_limit
  @ap_daily_limit && Float(@ap_daily_limit)
end

#max_payment_limitFloat?

maximum amount be paid with single payment

Returns:

  • (Float)

    AP_DAILY_LIMIT if set

  • (nil)

    if not set



31
32
33
# File 'lib/rubyplat/responses/check_balance_response.rb', line 31

def max_payment_limit
  @ap_payment_limit && Float(@ap_payment_limit)
end

#rest_limitFloat

REST field

Returns:

  • (Float)

    available amount for client



11
12
13
# File 'lib/rubyplat/responses/check_balance_response.rb', line 11

def rest_limit
 Float(@rest)
end

#success?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/rubyplat/responses/check_balance_response.rb', line 5

def success?
  error.to_i == 0
end