Class: Vpsa::Entity::Administrative::ThirdParty

Inherits:
Base
  • Object
show all
Defined in:
lib/vpsa/entity/administrative/third_party.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*h) ⇒ ThirdParty

Returns a new instance of ThirdParty.



9
10
11
12
13
14
15
16
# File 'lib/vpsa/entity/administrative/third_party.rb', line 9

def initialize(*h)
  self.emails = Array.new
  self.enderecos = Array.new
  self.telefones = Array.new
  self.classes = Array.new
  
  super
end

Instance Attribute Details

#classesObject

Returns the value of attribute classes.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def classes
  @classes
end

#dataNascimentoObject

Returns the value of attribute dataNascimento.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def dataNascimento
  @dataNascimento
end

#documentoObject

Returns the value of attribute documento.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def documento
  @documento
end

#emailsObject

Returns the value of attribute emails.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def emails
  @emails
end

#enderecosObject

Returns the value of attribute enderecos.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def enderecos
  @enderecos
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def id
  @id
end

#ieObject

Returns the value of attribute ie.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def ie
  @ie
end

#nomeObject

Returns the value of attribute nome.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def nome
  @nome
end

#rgObject

Returns the value of attribute rg.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def rg
  @rg
end

#telefonesObject

Returns the value of attribute telefones.



7
8
9
# File 'lib/vpsa/entity/administrative/third_party.rb', line 7

def telefones
  @telefones
end

Instance Method Details

#as_parameterObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vpsa/entity/administrative/third_party.rb', line 18

def as_parameter
  variables = instance_variables.map do |name|
    case name
      when :@enderecos, :@telefones
        [name.to_s.tr("@", ""), instance_variable_get(name).map(&:as_parameter)]
      else 
        [name.to_s.tr("@", ""), instance_variable_get(name)]
    end
  end
  
  Hash[variables.compact]
end