Class: WebmaniabrNfeRuby::Models::Product
- Inherits:
-
Object
- Object
- WebmaniabrNfeRuby::Models::Product
- Defined in:
- lib/models/product.rb
Instance Attribute Summary collapse
-
#cest ⇒ Object
Returns the value of attribute cest.
-
#cnpj_product ⇒ Object
Returns the value of attribute cnpj_product.
-
#ean ⇒ Object
Returns the value of attribute ean.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ncm ⇒ Object
Returns the value of attribute ncm.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#sku ⇒ Object
Returns the value of attribute sku.
-
#subtotal ⇒ Object
Returns the value of attribute subtotal.
-
#tax_class ⇒ Object
Returns the value of attribute tax_class.
-
#total ⇒ Object
Returns the value of attribute total.
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Product
constructor
A new instance of Product.
- #to_hash ⇒ Object
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 |
# File 'lib/models/product.rb', line 7 def initialize( = {}) @name = [:name] @sku = [:sku] @ean = [:ean] @ncm = [:ncm] @cest = [:cest] @cnpj_maker = [:cnpj_maker] @quantity = [:quantity] @unit = [:unit] @weight = [:weight] @origin = [:origin] @subtotal = [:subtotal] @total = [:total] @tax_class = [:tax_class] end |
Instance Attribute Details
#cest ⇒ Object
Returns the value of attribute cest.
4 5 6 |
# File 'lib/models/product.rb', line 4 def cest @cest end |
#cnpj_product ⇒ Object
Returns the value of attribute cnpj_product.
4 5 6 |
# File 'lib/models/product.rb', line 4 def cnpj_product @cnpj_product end |
#ean ⇒ Object
Returns the value of attribute ean.
4 5 6 |
# File 'lib/models/product.rb', line 4 def ean @ean end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/models/product.rb', line 4 def name @name end |
#ncm ⇒ Object
Returns the value of attribute ncm.
4 5 6 |
# File 'lib/models/product.rb', line 4 def ncm @ncm end |
#origin ⇒ Object
Returns the value of attribute origin.
4 5 6 |
# File 'lib/models/product.rb', line 4 def origin @origin end |
#quantity ⇒ Object
Returns the value of attribute quantity.
4 5 6 |
# File 'lib/models/product.rb', line 4 def quantity @quantity end |
#sku ⇒ Object
Returns the value of attribute sku.
4 5 6 |
# File 'lib/models/product.rb', line 4 def sku @sku end |
#subtotal ⇒ Object
Returns the value of attribute subtotal.
4 5 6 |
# File 'lib/models/product.rb', line 4 def subtotal @subtotal end |
#tax_class ⇒ Object
Returns the value of attribute tax_class.
4 5 6 |
# File 'lib/models/product.rb', line 4 def tax_class @tax_class end |
#total ⇒ Object
Returns the value of attribute total.
4 5 6 |
# File 'lib/models/product.rb', line 4 def total @total end |
#unit ⇒ Object
Returns the value of attribute unit.
4 5 6 |
# File 'lib/models/product.rb', line 4 def unit @unit end |
#weight ⇒ Object
Returns the value of attribute weight.
4 5 6 |
# File 'lib/models/product.rb', line 4 def weight @weight end |
Instance Method Details
#to_hash ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/models/product.rb', line 23 def to_hash { nome: @name, sku: @sku, ncm: @ncm, cest: @cest, cnpj_produtor: @cnpj_produtor, quantidade: @quantity, unidade: @unit, peso: @weight, origem: @origin, subtotal: @subtotal, total: @total, classe_imposto: @tax_class } end |