Class: MyMoip::CreditCard
- Inherits:
-
Object
- Object
- MyMoip::CreditCard
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/mymoip/credit_card.rb
Constant Summary collapse
- AVAILABLE_LOGOS =
[ :american_express, :diners, :hipercard, :mastercard, :visa ]
Instance Attribute Summary collapse
-
#card_number ⇒ Object
Returns the value of attribute card_number.
-
#expiration_date ⇒ Object
Returns the value of attribute expiration_date.
-
#logo ⇒ Object
Returns the value of attribute logo.
-
#owner_birthday ⇒ Object
Returns the value of attribute owner_birthday.
-
#owner_cpf ⇒ Object
Returns the value of attribute owner_cpf.
-
#owner_name ⇒ Object
Returns the value of attribute owner_name.
-
#owner_phone ⇒ Object
Returns the value of attribute owner_phone.
-
#perform_extra_validation ⇒ Object
Returns the value of attribute perform_extra_validation.
-
#security_code ⇒ Object
Returns the value of attribute security_code.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ CreditCard
constructor
A new instance of CreditCard.
- #owner_rg=(value) ⇒ Object
Constructor Details
#initialize(attrs) ⇒ CreditCard
Returns a new instance of CreditCard.
24 25 26 27 28 |
# File 'lib/mymoip/credit_card.rb', line 24 def initialize(attrs) attrs.each do |attr, value| public_send(:"#{attr}=", value) end end |
Instance Attribute Details
#card_number ⇒ Object
Returns the value of attribute card_number.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def card_number @card_number end |
#expiration_date ⇒ Object
Returns the value of attribute expiration_date.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def expiration_date @expiration_date end |
#logo ⇒ Object
Returns the value of attribute logo.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def logo @logo end |
#owner_birthday ⇒ Object
Returns the value of attribute owner_birthday.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def owner_birthday @owner_birthday end |
#owner_cpf ⇒ Object
Returns the value of attribute owner_cpf.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def owner_cpf @owner_cpf end |
#owner_name ⇒ Object
Returns the value of attribute owner_name.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def owner_name @owner_name end |
#owner_phone ⇒ Object
Returns the value of attribute owner_phone.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def owner_phone @owner_phone end |
#perform_extra_validation ⇒ Object
Returns the value of attribute perform_extra_validation.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def perform_extra_validation @perform_extra_validation end |
#security_code ⇒ Object
Returns the value of attribute security_code.
5 6 7 |
# File 'lib/mymoip/credit_card.rb', line 5 def security_code @security_code end |
Instance Method Details
#owner_rg=(value) ⇒ Object
51 52 53 54 |
# File 'lib/mymoip/credit_card.rb', line 51 def owner_rg=(value) warn "[DEPRECATION] `owner_rg` is deprecated. Please use `owner_cpf` instead." self.owner_cpf = value end |