Class: MyMoip::CreditCard

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_numberObject

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_dateObject

Returns the value of attribute expiration_date.



5
6
7
# File 'lib/mymoip/credit_card.rb', line 5

def expiration_date
  @expiration_date
end

#logoObject

Returns the value of attribute logo.



5
6
7
# File 'lib/mymoip/credit_card.rb', line 5

def 
  @logo
end

#owner_birthdayObject

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_cpfObject

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_nameObject

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_phoneObject

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_validationObject

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_codeObject

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