Class: Nfe::Customer
- Inherits:
-
Object
- Object
- Nfe::Customer
- Defined in:
- lib/nfe_reader/customer.rb
Overview
Identificação do Destinatário da Nota Fiscal eletrônica
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#cep ⇒ Object
readonly
Returns the value of attribute cep.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#city_code ⇒ Object
readonly
Returns the value of attribute city_code.
-
#city_registration ⇒ Object
readonly
Returns the value of attribute city_registration.
-
#cnpj ⇒ Object
readonly
Returns the value of attribute cnpj.
-
#complement ⇒ Object
readonly
Returns the value of attribute complement.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#cpf ⇒ Object
readonly
Returns the value of attribute cpf.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#foreign_code ⇒ Object
readonly
Returns the value of attribute foreign_code.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#neighborhood ⇒ Object
readonly
Returns the value of attribute neighborhood.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#state_registration ⇒ Object
readonly
Returns the value of attribute state_registration.
-
#state_registration_code ⇒ Object
readonly
Returns the value of attribute state_registration_code.
-
#suframa ⇒ Object
readonly
Returns the value of attribute suframa.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Customer
constructor
Fields Values.
Constructor Details
#initialize(attrs = {}) ⇒ Customer
Fields Values
indIEDest: 1 - Contribuinte ICMS (informar a IE do destinatário),
2 - Contribuinte isento de Inscri
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/nfe_reader/customer.rb', line 16 def initialize(attrs = {}) @cnpj = attrs[:CNPJ] @cpf = attrs[:CPF] # Razão Social ou nome do destinatário @name = attrs[:xNome] # Inscrição Estadual do Destinatário @state_registration = attrs[:IE] # Inscrição na SUFRAMA @suframa = attrs[:ISUF] # Inscrição Municipal do Tomador do Serviço @city_registration = attrs[:IM] # Indicador da IE do Destinatário @state_registration_code = attrs[:indIEDest] # Email @email = attrs[:email] # Identificação do destinatário no caso de comprador estrangeiro @foreign_code = attrs[:idEstrangeiro] # Address if attrs[:enderDest] # Logradouro @address = attrs[:enderDest][:xLgr] # Numero @number = attrs[:enderDest][:nro] # Complemento @complement = attrs[:enderDest][:xCpl] # Bairro @neighborhood = attrs[:enderDest][:xBairro] # Código do município @city_code = attrs[:enderDest][:cMun] # Nome do município @city = attrs[:enderDest][:xMun] # Sigla da UF @state = attrs[:enderDest][:UF] # Código do CEP @zip_code = attrs[:enderDest][:CEP] # Codigo Pais @country_code = attrs[:enderDest][:cPais] # Nome do Pais @country = attrs[:enderDest][:xPais] # Telefone @phone = attrs[:enderDest][:fone] end end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def address @address end |
#cep ⇒ Object (readonly)
Returns the value of attribute cep.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def cep @cep end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
5 6 7 |
# File 'lib/nfe_reader/customer.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/customer.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/customer.rb', line 5 def city_registration @city_registration end |
#cnpj ⇒ Object (readonly)
Returns the value of attribute cnpj.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def cnpj @cnpj end |
#complement ⇒ Object (readonly)
Returns the value of attribute complement.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def complement @complement end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
5 6 7 |
# File 'lib/nfe_reader/customer.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/customer.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/customer.rb', line 5 def cpf @cpf end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def email @email end |
#foreign_code ⇒ Object (readonly)
Returns the value of attribute foreign_code.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def foreign_code @foreign_code end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def name @name end |
#neighborhood ⇒ Object (readonly)
Returns the value of attribute neighborhood.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def neighborhood @neighborhood end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def number @number end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def phone @phone end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
5 6 7 |
# File 'lib/nfe_reader/customer.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/customer.rb', line 5 def state_registration @state_registration end |
#state_registration_code ⇒ Object (readonly)
Returns the value of attribute state_registration_code.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def state_registration_code @state_registration_code end |
#suframa ⇒ Object (readonly)
Returns the value of attribute suframa.
5 6 7 |
# File 'lib/nfe_reader/customer.rb', line 5 def suframa @suframa end |