class Deliveries::Delivery

Constants

ATTRIBUTES

Public Class Methods

new(**attributes) click to toggle source
# File lib/deliveries/delivery.rb, line 6
def initialize(**attributes)
  self.courier_id = attributes[:courier_id]
  self.sender = attributes[:sender]
  self.receiver = attributes[:receiver]
  self.parcels = attributes[:parcels]
  self.reference_code = attributes[:reference_code]
  self.tracking_code = attributes[:tracking_code]
  self.label = attributes[:label]
end

Public Instance Methods

attributes() click to toggle source
# File lib/deliveries/delivery.rb, line 16
def attributes
  ATTRIBUTES.map { |attr| { attr => send(attr) } }.inject(&:merge)
end