Class: NfeReader::Person

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper
Defined in:
lib/nfe_reader/person.rb

Constant Summary

Constants included from AttributeHelper

AttributeHelper::WITHELIST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributeHelper

#attributes, #attributes_to_hash

Constructor Details

#initialize(attrs = {}) ⇒ Person

Fields Values

CRT: 1 - Simples Nacional,

2 - Simples Nacional – excesso de sublimite de receita bruta,
3 - Regime Normal


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/nfe_reader/person.rb', line 17

def initialize(attrs = {})
  # CNPJ
  @cnpj = attrs[:CNPJ]
  # CPF
  @cpf = attrs[:CPF]
  # Inscricao Estadual
  @state_registration = attrs[:IE]
  # Inscricao Estadual ST
  @state_registration_st = attrs[:IEST]
  # Codigo Inscricao Estadual
  @state_registration_code = attrs[:indIEDest]
  # Incsricao municipal
  @city_registration = attrs[:IM]
  # Nome
  @name = attrs[:xNome]
  # Fantasia Empresa
  @fantasy = attrs[:xFant]
  # Telefone
  @phone = attrs[:fone]
  # Incricao Suframa
  @suframa = attrs[:ISUF]
  # Email
  @email = attrs[:email]
  # Estado
  @state = attrs[:UF]
  # Regime
  @regime = attrs[:CRT]
  # CNAE
  @cnae = attrs[:CNAE]
  # Identificação do destinatário no caso de comprador estrangeiro
  @foreign_code = attrs[:idEstrangeiro]
  # Proprietario do Veiculo
  @rntrc = attrs[:RNTRC]
  @owner_kind = attrs[:tpProp]
end

Instance Attribute Details

#city_registrationObject (readonly)

Returns the value of attribute city_registration.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def city_registration
  @city_registration
end

#cnaeObject (readonly)

Returns the value of attribute cnae.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def cnae
  @cnae
end

#cnpjObject (readonly)

Returns the value of attribute cnpj.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def cnpj
  @cnpj
end

#cpfObject (readonly)

Returns the value of attribute cpf.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def cpf
  @cpf
end

#emailObject (readonly)

Returns the value of attribute email.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def email
  @email
end

#fantasyObject (readonly)

Returns the value of attribute fantasy.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def fantasy
  @fantasy
end

#foreign_codeObject (readonly)

Returns the value of attribute foreign_code.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def foreign_code
  @foreign_code
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def name
  @name
end

#owner_kindObject (readonly)

Returns the value of attribute owner_kind.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def owner_kind
  @owner_kind
end

#phoneObject (readonly)

Returns the value of attribute phone.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def phone
  @phone
end

#regimeObject (readonly)

Returns the value of attribute regime.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def regime
  @regime
end

#rntrcObject (readonly)

Returns the value of attribute rntrc.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def rntrc
  @rntrc
end

#stateObject (readonly)

Returns the value of attribute state.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def state
  @state
end

#state_registrationObject (readonly)

Returns the value of attribute state_registration.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def state_registration
  @state_registration
end

#state_registration_codeObject (readonly)

Returns the value of attribute state_registration_code.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def state_registration_code
  @state_registration_code
end

#state_registration_stObject (readonly)

Returns the value of attribute state_registration_st.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def state_registration_st
  @state_registration_st
end

#suframaObject (readonly)

Returns the value of attribute suframa.



5
6
7
# File 'lib/nfe_reader/person.rb', line 5

def suframa
  @suframa
end