Class: MCFDI::Concept
Overview
Concepts Class
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#import ⇒ Object
Returns the value of attribute import.
-
#measure_unit ⇒ Object
Returns the value of attribute measure_unit.
-
#name ⇒ Object
Returns the value of attribute name.
-
#price ⇒ Object
Returns the value of attribute price.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Concept
constructor
A new instance of Concept.
-
#original_string ⇒ Object
return original string of concept.
-
#to_x ⇒ Object
return hash with values for invoice xml.
Methods inherited from Base
attr_accessor, attributes, #attributes, #to_h
Constructor Details
#initialize(args = {}) ⇒ Concept
Returns a new instance of Concept.
14 15 16 |
# File 'lib/m_cfdi/concept.rb', line 14 def initialize(args = {}) args.each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
12 13 14 |
# File 'lib/m_cfdi/concept.rb', line 12 def code @code end |
#import ⇒ Object
Returns the value of attribute import.
12 13 14 |
# File 'lib/m_cfdi/concept.rb', line 12 def import @import end |
#measure_unit ⇒ Object
Returns the value of attribute measure_unit.
12 13 14 |
# File 'lib/m_cfdi/concept.rb', line 12 def measure_unit @measure_unit end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/m_cfdi/concept.rb', line 12 def name @name end |
#price ⇒ Object
Returns the value of attribute price.
12 13 14 |
# File 'lib/m_cfdi/concept.rb', line 12 def price @price end |
#quantity ⇒ Object
Returns the value of attribute quantity.
12 13 14 |
# File 'lib/m_cfdi/concept.rb', line 12 def quantity @quantity end |
Instance Method Details
#original_string ⇒ Object
return original string of concept.
27 28 29 |
# File 'lib/m_cfdi/concept.rb', line 27 def original_string [@quantity, @measure_unit, @code, @name, @price.to_f, @import] end |
#to_x ⇒ Object
return hash with values for invoice xml.
32 33 34 35 |
# File 'lib/m_cfdi/concept.rb', line 32 def to_x { cantidad: @quantity, unidad: @measure_unit, noIdentificacion: @code, descripcion: @name, valorUnitario: @price, importe: @import } end |