Class: MercadoPublicoCl::TenderAward
- Inherits:
-
Data
- Object
- Data
- MercadoPublicoCl::TenderAward
- Defined in:
- lib/mercado_publico_cl/value_objects/tender_award.rb
Overview
Shape de la API: { Tipo, Fecha, Numero, NumeroOferentes, UrlActa }
Instance Attribute Summary collapse
-
#act_url ⇒ Object
readonly
Returns the value of attribute act_url.
-
#award_type_code ⇒ Object
readonly
Returns the value of attribute award_type_code.
-
#awarded? ⇒ Object
readonly
Returns the value of attribute awarded?.
-
#bidders_count ⇒ Object
readonly
Returns the value of attribute bidders_count.
-
#justification ⇒ Object
readonly
Returns the value of attribute justification.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#resolution_date ⇒ Object
readonly
Returns the value of attribute resolution_date.
-
#resolution_number ⇒ Object
readonly
Returns the value of attribute resolution_number.
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object (also: #to_s)
Instance Attribute Details
#act_url ⇒ Object (readonly)
Returns the value of attribute act_url
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34 def act_url @act_url end |
#award_type_code ⇒ Object (readonly)
Returns the value of attribute award_type_code
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34 def award_type_code @award_type_code end |
#awarded? ⇒ Object (readonly)
Returns the value of attribute awarded?
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34
def awarded?
@awarded?
end
|
#bidders_count ⇒ Object (readonly)
Returns the value of attribute bidders_count
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34 def bidders_count @bidders_count end |
#justification ⇒ Object (readonly)
Returns the value of attribute justification
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34 def justification @justification end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34 def raw @raw end |
#resolution_date ⇒ Object (readonly)
Returns the value of attribute resolution_date
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34 def resolution_date @resolution_date end |
#resolution_number ⇒ Object (readonly)
Returns the value of attribute resolution_number
34 35 36 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 34 def resolution_number @resolution_number end |
Class Method Details
.from_payload(raw) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 44 def self.from_payload(raw) return nil if raw.nil? || raw.empty? new( awarded?: true, resolution_number: raw["Numero"] || raw["NumeroActoAdjudicacion"] || raw["NumeroResolucion"], resolution_date: Resources::Base.parse_date( raw["Fecha"] || raw["FechaActoAdjudicacion"] || raw["FechaAdjudicacion"] ), award_type_code: Resources::Base.to_int(raw["Tipo"]), bidders_count: Resources::Base.to_int(raw["NumeroOferentes"]), act_url: raw["UrlActa"], justification: raw["Justificacion"], raw: raw ) end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
61 62 63 |
# File 'lib/mercado_publico_cl/value_objects/tender_award.rb', line 61 def inspect "#<TenderAward resolution=#{resolution_number.inspect} date=#{resolution_date}>" end |