Class: MercadoPublicoCl::TenderItem
- Inherits:
-
Data
- Object
- Data
- MercadoPublicoCl::TenderItem
- Defined in:
- lib/mercado_publico_cl/value_objects/tender_item.rb
Instance Attribute Summary collapse
-
#award ⇒ Object
readonly
Returns the value of attribute award.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#category_code ⇒ Object
readonly
Returns the value of attribute category_code.
-
#correlative ⇒ Object
readonly
Returns the value of attribute correlative.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#product_code ⇒ Object
readonly
Returns the value of attribute product_code.
-
#product_name ⇒ Object
readonly
Returns the value of attribute product_name.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#unit_of_measure ⇒ Object
readonly
Returns the value of attribute unit_of_measure.
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object (also: #to_s)
Instance Attribute Details
#award ⇒ Object (readonly)
Returns the value of attribute award
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def award @award end |
#category ⇒ Object (readonly)
Returns the value of attribute category
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def category @category end |
#category_code ⇒ Object (readonly)
Returns the value of attribute category_code
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def category_code @category_code end |
#correlative ⇒ Object (readonly)
Returns the value of attribute correlative
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def correlative @correlative end |
#description ⇒ Object (readonly)
Returns the value of attribute description
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def description @description end |
#product_code ⇒ Object (readonly)
Returns the value of attribute product_code
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def product_code @product_code end |
#product_name ⇒ Object (readonly)
Returns the value of attribute product_name
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def product_name @product_name end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def quantity @quantity end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def raw @raw end |
#unit_of_measure ⇒ Object (readonly)
Returns the value of attribute unit_of_measure
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 4 def unit_of_measure @unit_of_measure end |
Class Method Details
.from_payload(raw) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 16 def self.from_payload(raw) return nil if raw.nil? new( correlative: Resources::Base.to_int(raw["Correlativo"]), product_code: Resources::Base.to_int(raw["CodigoProducto"]), category_code: Resources::Base.to_int(raw["CodigoCategoria"]), category: raw["Categoria"], product_name: raw["NombreProducto"] || raw["Producto"], description: raw["Descripcion"], unit_of_measure: raw["UnidadMedida"], quantity: Resources::Base.to_float(raw["Cantidad"]), award: TenderItemAward.from_payload(raw["Adjudicacion"]), raw: raw ) end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
33 34 35 |
# File 'lib/mercado_publico_cl/value_objects/tender_item.rb', line 33 def inspect "#<TenderItem ##{correlative} product=#{product_name.inspect} qty=#{quantity}>" end |