Class: NfeReader::Vehicle

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper
Defined in:
lib/nfe_reader/product/vehicle.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 = {}) ⇒ Vehicle

Fields Values

pOp: 1 - Venda concessionária,

2 - Faturamento direto para consumidor final
3 - Venda direta para grandes consumidores (frotista, governo, ...)
0 - Outros

tpComb: 01-Álcool

02-Gasolina
03-Diesel
(...) - Tabela Renavam 2.0

tpVeic: Utilizar Tabela RENAVAM

06-AUTOMÓVEL
14-CAMINHÃO
13-CAMINHONETA
...

espVeic: Utilizar Tabela RENAVAM

1 - PASSAGEIRO
2 - CARGA
3 - MISTO
4 - CORRIDA
5 - TRAÇÃO
6 - ESPECIAL

VIN: R - Remarcado

N - Normal

condVeic: 1 - Acabado;

2 - Inacabado;
3 - Semi-acabado

cCorDEN: 01 - AMARELO

02 - AZUL
03 - BEGE
04 - BRANCA
05 - CINZA
06 - DOURADA
07 - GRENA
08 - LARANJA
09 - MARROM
10 - PRATA
11 - PRETA
12 - ROSA
13 - ROXA
14 - VERDE
15 - VERMELHA
16 - FANTASIA

tpRest: 0 - Não há;

1 - Alienação Fiduciária;
2 - Arrendamento Mercantil;
3 - Reserva de Domínio;
4 - Penhor de Veículos;


68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/nfe_reader/product/vehicle.rb', line 68

def initialize(attrs = {})
  # Tipo da operação
  @operation = attrs[:pOp]
  # Numero do Chassi
  @chassi = attrs[:chassi]
  # Cor do Fabricante
  @color = attrs[:cCor]
  # Nome da Cor do Fabricante
  @color_name = attrs[:xCor]
  # Potencia do Motor em CV
  @engine_power = attrs[:pot]
  # Potencia do Motor em CC
  @engine_capacities = attrs[:cilin]
  # Peso Liquido
  @weight_net = attrs[:pesoL]
  # Peso Bruto
  @weight_gross = attrs[:pesoB]
  # Numero serie
  @serie = attrs[:nSerie]
  # Tipo de Combustivel
  @fuel_kind = attrs[:tpComb]
  # Numeracao do Motor
  @engine_number = attrs[:nMotor]
  # CMT: Capacidade Maxima de Tração
  @cmt = attrs[:CMT]
  # Distancia entre os Eixos
  @wheelbase = attrs[:dist]
  # Ano do Modelo
  @year = attrs[:anoMod]
  # Ano de Fabricacao
  @fabrication_year = attrs[:anoFab]
  # Tipo de Pintura
  @paint_kind = attrs[:tpPint]
  # Tipo de Veiculo
  @kind = attrs[:tpVeic]
  # Especie do veiculo
  @vehicle_kind = attrs[:espVeic]
  # Condição do VIN
  @vin = attrs[:VIN]
  # Condições do Veiculo
  @condiction = attrs[:condVeic]
  # Modelo
  @model = attrs[:cMod]
  # Codigo da Cor
  @color_code = attrs[:cCorDEN]
  # Capacidade
  @capacity = attrs[:lota]
  # Restrição
  @restriction = attrs[:tpRest]
end

Instance Attribute Details

#capacityObject (readonly)

Returns the value of attribute capacity.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def capacity
  @capacity
end

#chassiObject (readonly)

Returns the value of attribute chassi.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def chassi
  @chassi
end

#cmtObject (readonly)

Returns the value of attribute cmt.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def cmt
  @cmt
end

#colorObject (readonly)

Returns the value of attribute color.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def color
  @color
end

#color_codeObject (readonly)

Returns the value of attribute color_code.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def color_code
  @color_code
end

#color_nameObject (readonly)

Returns the value of attribute color_name.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def color_name
  @color_name
end

#condictionObject (readonly)

Returns the value of attribute condiction.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def condiction
  @condiction
end

#engine_capacitiesObject (readonly)

Returns the value of attribute engine_capacities.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def engine_capacities
  @engine_capacities
end

#engine_numberObject (readonly)

Returns the value of attribute engine_number.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def engine_number
  @engine_number
end

#engine_powerObject (readonly)

Returns the value of attribute engine_power.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def engine_power
  @engine_power
end

#fabrication_yearObject (readonly)

Returns the value of attribute fabrication_year.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def fabrication_year
  @fabrication_year
end

#fuel_kindObject (readonly)

Returns the value of attribute fuel_kind.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def fuel_kind
  @fuel_kind
end

#kindObject (readonly)

Returns the value of attribute kind.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def kind
  @kind
end

#modelObject (readonly)

Returns the value of attribute model.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def model
  @model
end

#operationObject (readonly)

Returns the value of attribute operation.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def operation
  @operation
end

#paint_kindObject (readonly)

Returns the value of attribute paint_kind.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def paint_kind
  @paint_kind
end

#restrictionObject (readonly)

Returns the value of attribute restriction.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def restriction
  @restriction
end

#serieObject (readonly)

Returns the value of attribute serie.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def serie
  @serie
end

#vehicle_kindObject (readonly)

Returns the value of attribute vehicle_kind.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def vehicle_kind
  @vehicle_kind
end

#vinObject (readonly)

Returns the value of attribute vin.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def vin
  @vin
end

#weight_grossObject (readonly)

Returns the value of attribute weight_gross.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def weight_gross
  @weight_gross
end

#weight_netObject (readonly)

Returns the value of attribute weight_net.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def weight_net
  @weight_net
end

#wheelbaseObject (readonly)

Returns the value of attribute wheelbase.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def wheelbase
  @wheelbase
end

#yearObject (readonly)

Returns the value of attribute year.



6
7
8
# File 'lib/nfe_reader/product/vehicle.rb', line 6

def year
  @year
end