Class: Amex::CardAccount
- Inherits:
-
Object
- Object
- Amex::CardAccount
- Defined in:
- lib/amex/card_account.rb
Instance Attribute Summary collapse
-
#cancelled ⇒ Object
Returns the value of attribute cancelled.
-
#card_art ⇒ Object
Returns the value of attribute card_art.
-
#card_member_name ⇒ Object
Returns the value of attribute card_member_name.
-
#card_number_suffix ⇒ Object
Returns the value of attribute card_number_suffix.
-
#card_product ⇒ Object
Returns the value of attribute card_product.
-
#is_basic ⇒ Object
Returns the value of attribute is_basic.
-
#is_centurion ⇒ Object
Returns the value of attribute is_centurion.
-
#is_platinum ⇒ Object
Returns the value of attribute is_platinum.
-
#is_premium ⇒ Object
Returns the value of attribute is_premium.
-
#lending_type ⇒ Object
Returns the value of attribute lending_type.
-
#loyalty_indicator ⇒ Object
Returns the value of attribute loyalty_indicator.
-
#loyalty_programmes ⇒ Object
Returns the value of attribute loyalty_programmes.
-
#market ⇒ Object
Returns the value of attribute market.
-
#past_due ⇒ Object
Returns the value of attribute past_due.
-
#payment_credits ⇒ Object
Returns the value of attribute payment_credits.
-
#payment_due ⇒ Object
Returns the value of attribute payment_due.
-
#payment_due_date ⇒ Object
Returns the value of attribute payment_due_date.
-
#recent_charges ⇒ Object
Returns the value of attribute recent_charges.
-
#stmt_balance ⇒ Object
Returns the value of attribute stmt_balance.
-
#total_balance ⇒ Object
Returns the value of attribute total_balance.
Instance Method Summary collapse
- #cancelled? ⇒ Boolean
- #due? ⇒ Boolean
-
#initialize(options) ⇒ CardAccount
constructor
A new instance of CardAccount.
- #is_charge_card? ⇒ Boolean
- #is_credit_card? ⇒ Boolean
- #loyalty_balances ⇒ Object
- #loyalty_enabled? ⇒ Boolean
- #overdue? ⇒ Boolean
- #product ⇒ Object
- #statement_balance ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(options) ⇒ CardAccount
Returns a new instance of CardAccount.
9 10 11 12 13 14 15 |
# File 'lib/amex/card_account.rb', line 9 def initialize() .each do |key, value| method = key.underscore + "=" send(key.underscore + "=", value) if respond_to? method.to_sym end @loyalty_programmes = [] end |
Instance Attribute Details
#cancelled ⇒ Object
Returns the value of attribute cancelled.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def cancelled @cancelled end |
#card_art ⇒ Object
Returns the value of attribute card_art.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def card_art @card_art end |
#card_member_name ⇒ Object
Returns the value of attribute card_member_name.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def card_member_name @card_member_name end |
#card_number_suffix ⇒ Object
Returns the value of attribute card_number_suffix.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def card_number_suffix @card_number_suffix end |
#card_product ⇒ Object
Returns the value of attribute card_product.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def card_product @card_product end |
#is_basic ⇒ Object
Returns the value of attribute is_basic.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def is_basic @is_basic end |
#is_centurion ⇒ Object
Returns the value of attribute is_centurion.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def is_centurion @is_centurion end |
#is_platinum ⇒ Object
Returns the value of attribute is_platinum.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def is_platinum @is_platinum end |
#is_premium ⇒ Object
Returns the value of attribute is_premium.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def is_premium @is_premium end |
#lending_type ⇒ Object
Returns the value of attribute lending_type.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def lending_type @lending_type end |
#loyalty_indicator ⇒ Object
Returns the value of attribute loyalty_indicator.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def loyalty_indicator @loyalty_indicator end |
#loyalty_programmes ⇒ Object
Returns the value of attribute loyalty_programmes.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def loyalty_programmes @loyalty_programmes end |
#market ⇒ Object
Returns the value of attribute market.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def market @market end |
#past_due ⇒ Object
Returns the value of attribute past_due.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def past_due @past_due end |
#payment_credits ⇒ Object
Returns the value of attribute payment_credits.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def payment_credits @payment_credits end |
#payment_due ⇒ Object
Returns the value of attribute payment_due.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def payment_due @payment_due end |
#payment_due_date ⇒ Object
Returns the value of attribute payment_due_date.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def payment_due_date @payment_due_date end |
#recent_charges ⇒ Object
Returns the value of attribute recent_charges.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def recent_charges @recent_charges end |
#stmt_balance ⇒ Object
Returns the value of attribute stmt_balance.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def stmt_balance @stmt_balance end |
#total_balance ⇒ Object
Returns the value of attribute total_balance.
3 4 5 |
# File 'lib/amex/card_account.rb', line 3 def total_balance @total_balance end |
Instance Method Details
#cancelled? ⇒ Boolean
25 26 27 |
# File 'lib/amex/card_account.rb', line 25 def cancelled? @cancelled end |
#due? ⇒ Boolean
57 58 59 60 |
# File 'lib/amex/card_account.rb', line 57 def due? return true if @payment_due.to_f > 0 false end |
#is_charge_card? ⇒ Boolean
47 48 49 50 |
# File 'lib/amex/card_account.rb', line 47 def is_charge_card? return true if @lending_type == "Charge" false end |
#is_credit_card? ⇒ Boolean
42 43 44 45 |
# File 'lib/amex/card_account.rb', line 42 def is_credit_card? return true if @lending_type == "Credit" false end |
#loyalty_balances ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/amex/card_account.rb', line 66 def loyalty_balances result = {} @loyalty_programmes.each do |programme| result[programme.name] = programme.balance end result end |
#loyalty_enabled? ⇒ Boolean
62 63 64 |
# File 'lib/amex/card_account.rb', line 62 def loyalty_enabled? @loyalty_indicator end |
#overdue? ⇒ Boolean
52 53 54 55 |
# File 'lib/amex/card_account.rb', line 52 def overdue? return true if @past_due false end |
#product ⇒ Object
21 22 23 |
# File 'lib/amex/card_account.rb', line 21 def product @card_product end |
#statement_balance ⇒ Object
17 18 19 |
# File 'lib/amex/card_account.rb', line 17 def statement_balance @stmt_balance end |
#type ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/amex/card_account.rb', line 34 def type return :basic if @is_basic return :platinum if @is_platinum return :centurion if @is_centurion return :premium if @is_premium :unknown end |