Class: PagSeguro::Document
- Inherits:
-
Object
- Object
- PagSeguro::Document
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/pagseguro/document.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Set the document type CPF or CNPJ is acceptable.
-
#value ⇒ Object
Set the document number.
Instance Method Summary collapse
- #cpf? ⇒ Boolean
-
#initialize(value, type = 'CPF') ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(value, type = 'CPF') ⇒ Document
Returns a new instance of Document.
15 16 17 18 |
# File 'lib/pagseguro/document.rb', line 15 def initialize(value, type = 'CPF') @type = type @value = value end |
Instance Attribute Details
#type ⇒ Object
Set the document type CPF or CNPJ is acceptable
10 11 12 |
# File 'lib/pagseguro/document.rb', line 10 def type @type end |
#value ⇒ Object
Set the document number.
13 14 15 |
# File 'lib/pagseguro/document.rb', line 13 def value @value end |
Instance Method Details
#cpf? ⇒ Boolean
20 21 22 |
# File 'lib/pagseguro/document.rb', line 20 def cpf? type == "CPF" end |