Class: PagSeguro::Document

Inherits:
Object
  • Object
show all
Includes:
Extensions::MassAssignment
Defined in:
lib/pagseguro/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Extensions::MassAssignment

#initialize

Instance Attribute Details

#typeObject

Set the type.



6
7
8
# File 'lib/pagseguro/document.rb', line 6

def type
  @type
end

#valueObject

Set the value.



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

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



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

def ==(other)
  [type, value] == [other.type, other.value]
end

#cnpj?Boolean

Returns:

  • (Boolean)


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

def cnpj?
  type == 'CNPJ'
end

#cpf?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/pagseguro/document.rb', line 15

def cpf?
  type == 'CPF'
end