Class: Deliveries::Shipment

Inherits:
Delivery show all
Defined in:
lib/deliveries/shipment.rb

Constant Summary

Constants inherited from Delivery

Delivery::ATTRIBUTES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Delivery

#attributes

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_dateObject

Returns the value of attribute shipment_date.



3
4
5
# File 'lib/deliveries/shipment.rb', line 3

def shipment_date
  @shipment_date
end