Class: Deliveries::Couriers::MondialRelayDual::Shipments::Create::FormatParams
- Inherits:
-
Object
- Object
- Deliveries::Couriers::MondialRelayDual::Shipments::Create::FormatParams
- Defined in:
- lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#collection_point ⇒ Object
Returns the value of attribute collection_point.
-
#language ⇒ Object
Returns the value of attribute language.
-
#parcels ⇒ Object
Returns the value of attribute parcels.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
-
#reference_code ⇒ Object
Returns the value of attribute reference_code.
-
#remarks ⇒ Object
Returns the value of attribute remarks.
-
#sender ⇒ Object
Returns the value of attribute sender.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(sender:, receiver:, parcels:, reference_code:, collection_point:, remarks:, language:) ⇒ FormatParams
constructor
A new instance of FormatParams.
Constructor Details
#initialize(sender:, receiver:, parcels:, reference_code:, collection_point:, remarks:, language:) ⇒ FormatParams
Returns a new instance of FormatParams.
9 10 11 12 13 14 15 16 17 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 9 def initialize(sender:, receiver:, parcels:, reference_code:, collection_point:, remarks:, language:) self.sender = sender.courierize(:mondial_relay_dual) self.receiver = receiver.courierize(:mondial_relay_dual) self.parcels = parcels self.reference_code = reference_code self.collection_point = collection_point self.remarks = remarks self.language = language end |
Instance Attribute Details
#collection_point ⇒ Object
Returns the value of attribute collection_point.
7 8 9 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 7 def collection_point @collection_point end |
#language ⇒ Object
Returns the value of attribute language.
7 8 9 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 7 def language @language end |
#parcels ⇒ Object
Returns the value of attribute parcels.
7 8 9 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 7 def parcels @parcels end |
#receiver ⇒ Object
Returns the value of attribute receiver.
7 8 9 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 7 def receiver @receiver end |
#reference_code ⇒ Object
Returns the value of attribute reference_code.
7 8 9 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 7 def reference_code @reference_code end |
#remarks ⇒ Object
Returns the value of attribute remarks.
7 8 9 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 7 def remarks @remarks end |
#sender ⇒ Object
Returns the value of attribute sender.
7 8 9 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 7 def sender @sender end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/deliveries/couriers/mondial_relay_dual/shipments/create/format_params.rb', line 19 def execute { culture: culture, order_no: reference_code, parcel_count: parcels.to_i, delivery_mode: delivery_mode, collection_mode: collection_mode, deliver_instruction: remarks, parcels: parcel_list, sender: { streetname: sender.street, country_code: sender.country, post_code: sender.postcode, city: sender.city, address_add_1: sender.name, phone_no: sender.phone, email: sender.email }, recipient: { streetname: receiver.street, country_code: receiver.country, post_code: receiver.postcode, city: receiver.city, address_add_1: receiver.name, phone_no: receiver.phone, email: receiver.email } } end |