Class: MercadoPublicoCl::TenderItemAward
- Inherits:
-
Data
- Object
- Data
- MercadoPublicoCl::TenderItemAward
- Defined in:
- lib/mercado_publico_cl/value_objects/tender_award.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#supplier_branch ⇒ Object
readonly
Returns the value of attribute supplier_branch.
-
#supplier_code ⇒ Object
readonly
Returns the value of attribute supplier_code.
-
#supplier_name ⇒ Object
readonly
Returns the value of attribute supplier_name.
-
#supplier_rut ⇒ Object
readonly
Returns the value of attribute supplier_rut.
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object (also: #to_s)
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 4 def amount @amount end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.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_award.rb', line 4 def raw @raw end |
#supplier_branch ⇒ Object (readonly)
Returns the value of attribute supplier_branch
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 4 def supplier_branch @supplier_branch end |
#supplier_code ⇒ Object (readonly)
Returns the value of attribute supplier_code
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 4 def supplier_code @supplier_code end |
#supplier_name ⇒ Object (readonly)
Returns the value of attribute supplier_name
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 4 def supplier_name @supplier_name end |
#supplier_rut ⇒ Object (readonly)
Returns the value of attribute supplier_rut
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 4 def supplier_rut @supplier_rut end |
Class Method Details
.from_payload(raw) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 13 def self.from_payload(raw) return nil if raw.nil? || raw.empty? new( supplier_code: Resources::Base.to_int(raw["CodigoEmpresa"] || raw["CodigoProveedor"]), supplier_rut: raw["RutProveedor"] || raw["RutSucursal"] || raw["Rut"], supplier_name: raw["NombreProveedor"] || raw["NombreOferente"] || raw["Nombre"], supplier_branch: raw["NombreSucursal"], quantity: Resources::Base.to_float(raw["Cantidad"]), amount: Resources::Base.to_float(raw["MontoUnitario"] || raw["Monto"]), raw: raw ) end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
27 28 29 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 27 def inspect "#<TenderItemAward supplier=#{supplier_name.inspect} qty=#{quantity}>" end |