Class: WebmaniabrNfeRuby::Models::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/models/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Product

Returns a new instance of Product.



7
8
9
10
11
12
13
14
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
42
# File 'lib/models/product.rb', line 7

def initialize(options = {})
  @name             = options[:name]
  @sku              = options[:sku]
  @ean              = options[:ean]
  @ncm              = options[:ncm]
  @cest             = options[:cest]
  @nve              = options[:nve]
  @cnpj_maker       = options[:cnpj_maker]
  @special          = options[:special]
  @drawback         = options[:drawback]
  @reg_exportation  = options[:reg_exportation]
  @nfe_exportation  = options[:nfe_exportation]
  @qtd_exportation  = options[:qtd_exportation]
  @ndoc_import      = options[:ndoc_import]
  @ddoc_import      = options[:ddoc_import]
  @local_clearance  = options[:local_clearance]
  @uf_clearance     = options[:uf_clearance]
  @clearance_date   = options[:clearance_date]
  @ship_type        = options[:ship_type]
  @afrmm            = options[:afrmm]
  @intermediation   = options[:intermediation]
  @cnpj_requester   = options[:cnpj_requester]
  @cod_exportation  = options[:cod_exportation]
  @nfci             = options[:nfci]
  @addition         = options[:addition]
  @seq_addition     = options[:seq_addition]
  @maker            = options[:maker]
  @customs_expenses = options[:customs_expenses]
  @quantity         = options[:quantity]
  @unit             = options[:unit]
  @weight           = options[:weight]
  @origin           = options[:origin]
  @subtotal         = options[:subtotal]
  @total            = options[:total]
  @tax_class        = options[:tax_class]
end

Instance Attribute Details

#cestObject

Returns the value of attribute cest.



4
5
6
# File 'lib/models/product.rb', line 4

def cest
  @cest
end

#cnpj_productObject

Returns the value of attribute cnpj_product.



4
5
6
# File 'lib/models/product.rb', line 4

def cnpj_product
  @cnpj_product
end

#eanObject

Returns the value of attribute ean.



4
5
6
# File 'lib/models/product.rb', line 4

def ean
  @ean
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/models/product.rb', line 4

def name
  @name
end

#ncmObject

Returns the value of attribute ncm.



4
5
6
# File 'lib/models/product.rb', line 4

def ncm
  @ncm
end

#originObject

Returns the value of attribute origin.



4
5
6
# File 'lib/models/product.rb', line 4

def origin
  @origin
end

#quantityObject

Returns the value of attribute quantity.



4
5
6
# File 'lib/models/product.rb', line 4

def quantity
  @quantity
end

#skuObject

Returns the value of attribute sku.



4
5
6
# File 'lib/models/product.rb', line 4

def sku
  @sku
end

#subtotalObject

Returns the value of attribute subtotal.



4
5
6
# File 'lib/models/product.rb', line 4

def subtotal
  @subtotal
end

#tax_classObject

Returns the value of attribute tax_class.



4
5
6
# File 'lib/models/product.rb', line 4

def tax_class
  @tax_class
end

#totalObject

Returns the value of attribute total.



4
5
6
# File 'lib/models/product.rb', line 4

def total
  @total
end

#unitObject

Returns the value of attribute unit.



4
5
6
# File 'lib/models/product.rb', line 4

def unit
  @unit
end

#weightObject

Returns the value of attribute weight.



4
5
6
# File 'lib/models/product.rb', line 4

def weight
  @weight
end

Instance Method Details

#to_hashObject



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/models/product.rb', line 44

def to_hash
  {
    nome: @name,
    sku: @sku,
    ncm: @ncm,
    cest: @cest,
    nve: @nve,
    cnpj_produtor: @cnpj_produtor,
    especial: @special,
    drawback: @drawback,
    reg_exportacao: @reg_exportation,
    nfe_exportacao: @nfe_exportation,
    qtd_exportacao: @qtd_exportation,
    ndoc_importacao: @ndoc_import,
    ddoc_importacao: @ddoc_import,
    local_desembaraco: @local_clearance,
    uf_desembaraco: @uf_clearance,
    data_desembaraco: @clearance_date,
    via_transporte: @ship_type,
    afrmm: @afrmm,
    intermediacao: @intermediacao,
    cnpj_terceiro: @cnpj_requester,
    nfci: @nfci,
    seq_adicao: @seq_addition,
    fabricante: @maker,
    despesas_aduaneiras: @customs_expenses,
    quantidade: @quantity,
    unidade: @unit,
    peso: @weight,
    origem: @origin,
    subtotal: @subtotal,
    total: @total,
    classe_imposto: @tax_class
  }
end