Class: Aviate::Wallet
- Inherits:
-
Object
- Object
- Aviate::Wallet
- Defined in:
- app/services/aviate/wallet.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#credit_type ⇒ Object
Returns the value of attribute credit_type.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#exp_date ⇒ Object
Returns the value of attribute exp_date.
-
#exp_duration_length ⇒ Object
Returns the value of attribute exp_duration_length.
-
#exp_duration_unit ⇒ Object
Returns the value of attribute exp_duration_unit.
-
#kb_account_id ⇒ Object
Returns the value of attribute kb_account_id.
-
#live_balance ⇒ Object
Returns the value of attribute live_balance.
-
#low_watermark ⇒ Object
Returns the value of attribute low_watermark.
-
#top_off_amount ⇒ Object
Returns the value of attribute top_off_amount.
-
#top_off_type ⇒ Object
Returns the value of attribute top_off_type.
-
#wallet_id ⇒ Object
Returns the value of attribute wallet_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Wallet
constructor
A new instance of Wallet.
- #to_api_params ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Wallet
Returns a new instance of Wallet.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/services/aviate/wallet.rb', line 9 def initialize(attributes = {}) @wallet_id = attributes[:wallet_id] @kb_account_id = attributes[:kb_account_id] @currency = attributes[:currency] @balance = attributes[:balance] @live_balance = attributes[:live_balance] @credit_type = attributes[:credit_type] @amount = attributes[:amount] @exp_date = attributes[:exp_date] @top_off_type = attributes[:top_off_type] @low_watermark = attributes[:low_watermark] @top_off_amount = attributes[:top_off_amount] @exp_duration_unit = attributes[:exp_duration_unit] @exp_duration_length = attributes[:exp_duration_length] end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def amount @amount end |
#balance ⇒ Object
Returns the value of attribute balance.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def balance @balance end |
#credit_type ⇒ Object
Returns the value of attribute credit_type.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def credit_type @credit_type end |
#currency ⇒ Object
Returns the value of attribute currency.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def currency @currency end |
#exp_date ⇒ Object
Returns the value of attribute exp_date.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def exp_date @exp_date end |
#exp_duration_length ⇒ Object
Returns the value of attribute exp_duration_length.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def exp_duration_length @exp_duration_length end |
#exp_duration_unit ⇒ Object
Returns the value of attribute exp_duration_unit.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def exp_duration_unit @exp_duration_unit end |
#kb_account_id ⇒ Object
Returns the value of attribute kb_account_id.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def kb_account_id @kb_account_id end |
#live_balance ⇒ Object
Returns the value of attribute live_balance.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def live_balance @live_balance end |
#low_watermark ⇒ Object
Returns the value of attribute low_watermark.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def low_watermark @low_watermark end |
#top_off_amount ⇒ Object
Returns the value of attribute top_off_amount.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def top_off_amount @top_off_amount end |
#top_off_type ⇒ Object
Returns the value of attribute top_off_type.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def top_off_type @top_off_type end |
#wallet_id ⇒ Object
Returns the value of attribute wallet_id.
5 6 7 |
# File 'app/services/aviate/wallet.rb', line 5 def wallet_id @wallet_id end |
Class Method Details
.from_api_response(response) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/services/aviate/wallet.rb', line 25 def self.from_api_response(response) { wallet_id: response['walletId'], kb_account_id: response['kbAccountId'], currency: response['currency'], balance: response['balance'], live_balance: response['liveBalance'], credit_type: response['creditType'], amount: response['amount'], exp_date: response['expDate'], top_off_type: response['topOff']['topOffType'], low_watermark: response['topOff']['lowWatermark'], top_off_amount: response['topOff']['amount'], exp_duration_unit: response['topOff']['expDurationUnit'], exp_duration_length: response['topOff']['expDurationLength'] } end |
Instance Method Details
#to_api_params ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/services/aviate/wallet.rb', line 43 def to_api_params { currency: @currency, credit_type: @credit_type, amount: @amount, exp_date: @exp_date, top_off_type: @top_off_type, low_watermark: @low_watermark, top_off_amount: @top_off_amount, exp_duration_unit: @exp_duration_unit, exp_duration_length: @exp_duration_length }.compact end |