Class: Deliveries::Pickup

Inherits:
Delivery show all
Defined in:
lib/deliveries/pickup.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) ⇒ Pickup

Returns a new instance of Pickup.



5
6
7
8
9
10
11
12
13
# File 'lib/deliveries/pickup.rb', line 5

def initialize(delivery: nil, **attributes)
  if delivery.is_a? Deliveries::Delivery
    super(**delivery.attributes)
  else
    super(**attributes)
  end

  self.pickup_date = attributes[:pickup_date]
end

Instance Attribute Details

#pickup_dateObject

Returns the value of attribute pickup_date.



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

def pickup_date
  @pickup_date
end