Class: Nfe::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/nfe_reader/provider.rb

Overview

Identificação do Emitente da Nota Fiscal eletrônica

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Provider

Fields Values

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



15
16
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
# File 'lib/nfe_reader/provider.rb', line 15

def initialize(attrs = {})
  # Provider Info
  @cnpj = attrs[:CNPJ]
  @cpf = attrs[:CPF]
  @name = attrs[:xNome]
  @fantasy = attrs[:xFant]
  @state_registration = attrs[:IE]
  @state_registration_st = attrs[:IEST]
  @city_registration = attrs[:IM]
  @regime = attrs[:CRT]
  @cnae = attrs[:CNAE]

  # Address
  if attrs[:enderEmit]
    @phone = attrs[:enderEmit][:fone]
    @address = attrs[:enderEmit][:xLgr]
    @number = attrs[:enderEmit][:nro]
    @complement = attrs[:enderEmit][:xCpl]
    @neighborhood = attrs[:enderEmit][:xBairro]
    @city_code = attrs[:enderEmit][:cMun]
    @city = attrs[:enderEmit][:xMun]
    @zip_code = attrs[:enderEmit][:CEP]
    @country_code = attrs[:enderEmit][:cPais]
    @country = attrs[:enderEmit][:xPais]
    @state = attrs[:enderEmit][:UF]
  end
end

Instance Attribute Details

#address ⇒ Object (readonly)

Returns the value of attribute address.



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

def address
  @address
end

#city ⇒ Object (readonly)

Returns the value of attribute city.



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

def city
  @city
end

#city_code ⇒ Object (readonly)

Returns the value of attribute city_code.



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

def city_code
  @city_code
end

#city_registration ⇒ Object (readonly)

Returns the value of attribute city_registration.



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

def city_registration
  @city_registration
end

#cnae ⇒ Object (readonly)

Returns the value of attribute cnae.



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

def cnae
  @cnae
end

#cnpj ⇒ Object (readonly)

Returns the value of attribute cnpj.



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

def cnpj
  @cnpj
end

#complement ⇒ Object (readonly)

Returns the value of attribute complement.



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

def complement
  @complement
end

#country ⇒ Object (readonly)

Returns the value of attribute country.



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

def country
  @country
end

#country_code ⇒ Object (readonly)

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#cpf ⇒ Object (readonly)

Returns the value of attribute cpf.



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

def cpf
  @cpf
end

#fantasy ⇒ Object (readonly)

Returns the value of attribute fantasy.



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

def fantasy
  @fantasy
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#neighborhood ⇒ Object (readonly)

Returns the value of attribute neighborhood.



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

def neighborhood
  @neighborhood
end

#number ⇒ Object (readonly)

Returns the value of attribute number.



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

def number
  @number
end

#phone ⇒ Object (readonly)

Returns the value of attribute phone.



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

def phone
  @phone
end

#regime ⇒ Object (readonly)

Returns the value of attribute regime.



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

def regime
  @regime
end

#state ⇒ Object (readonly)

Returns the value of attribute state.



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

def state
  @state
end

#state_registration ⇒ Object (readonly)

Returns the value of attribute state_registration.



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

def state_registration
  @state_registration
end

#state_registration_st ⇒ Object (readonly)

Returns the value of attribute state_registration_st.



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

def state_registration_st
  @state_registration_st
end

#zip_code ⇒ Object (readonly)

Returns the value of attribute zip_code.



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

def zip_code
  @zip_code
end