Class: MercadoPublicoCl::PODates
- Inherits:
-
Data
- Object
- Data
- MercadoPublicoCl::PODates
- Defined in:
- lib/mercado_publico_cl/value_objects/purchase_order_dates.rb
Instance Attribute Summary collapse
-
#acceptance ⇒ Object
readonly
Returns the value of attribute acceptance.
-
#cancellation ⇒ Object
readonly
Returns the value of attribute cancellation.
-
#creation ⇒ Object
readonly
Returns the value of attribute creation.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#sent ⇒ Object
readonly
Returns the value of attribute sent.
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object (also: #to_s)
Instance Attribute Details
#acceptance ⇒ Object (readonly)
Returns the value of attribute acceptance
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 4 def acceptance @acceptance end |
#cancellation ⇒ Object (readonly)
Returns the value of attribute cancellation
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 4 def cancellation @cancellation end |
#creation ⇒ Object (readonly)
Returns the value of attribute creation
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 4 def creation @creation end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 4 def last_modified @last_modified end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 4 def raw @raw end |
#sent ⇒ Object (readonly)
Returns the value of attribute sent
4 5 6 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 4 def sent @sent end |
Class Method Details
.from_payload(raw) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 12 def self.from_payload(raw) return nil if raw.nil? || raw.empty? new( creation: Resources::Base.parse_date(raw["FechaCreacion"]), sent: Resources::Base.parse_date(raw["FechaEnvio"]), acceptance: Resources::Base.parse_date(raw["FechaAceptacion"]), cancellation: Resources::Base.parse_date(raw["FechaCancelacion"]), last_modified: Resources::Base.parse_date(raw["FechaUltimaModificacion"]), raw: raw ) end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
25 26 27 |
# File 'lib/mercado_publico_cl/value_objects/purchase_order_dates.rb', line 25 def inspect "#<PODates creation=#{creation} acceptance=#{acceptance} last_modified=#{last_modified}>" end |