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



18
19
20
21
22
# File 'lib/mymoip/credit_card.rb', line 18

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 
  
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

#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



46
47
48
49
# File 'lib/mymoip/credit_card.rb', line 46

def owner_rg=(value)
  warn "[DEPRECATION] `owner_rg` is deprecated. Please use `owner_cpf` instead."
  self.owner_cpf = value
end