Class: PagSeguro::Document

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/pagseguro/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#typeObject

Set the document type CPF or CNPJ is acceptable



10
11
12
# File 'lib/pagseguro/document.rb', line 10

def type
  @type
end

#valueObject

Set the document number.



13
14
15
# File 'lib/pagseguro/document.rb', line 13

def value
  @value
end

Instance Method Details

#cpf?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pagseguro/document.rb', line 20

def cpf?
  type == "CPF"
end