Class: Deliveries::Shipment
- Defined in:
- lib/deliveries/shipment.rb
Constant Summary
Constants inherited from Delivery
Instance Attribute Summary collapse
-
#shipment_date ⇒ Object
Returns the value of attribute shipment_date.
Instance Method Summary collapse
-
#initialize(delivery: nil, **attributes) ⇒ Shipment
constructor
A new instance of Shipment.
Methods inherited from Delivery
Constructor Details
#initialize(delivery: nil, **attributes) ⇒ Shipment
Returns a new instance of Shipment.
5 6 7 8 9 10 11 12 13 |
# File 'lib/deliveries/shipment.rb', line 5 def initialize(delivery: nil, **attributes) if delivery.is_a? Deliveries::Delivery super(**delivery.attributes) else super(**attributes) end self.shipment_date = attributes[:shipment_date] end |
Instance Attribute Details
#shipment_date ⇒ Object
Returns the value of attribute shipment_date.
3 4 5 |
# File 'lib/deliveries/shipment.rb', line 3 def shipment_date @shipment_date end |