Class: FriendlyShipping::Services::RL::ShipmentInformation
- Inherits:
-
Object
- Object
- FriendlyShipping::Services::RL::ShipmentInformation
- Defined in:
- lib/friendly_shipping/services/rl/shipment_information.rb
Overview
Represents information for a specific shipment. This includes one or more documents, a PRO number, and a pickup request number.
Instance Attribute Summary collapse
-
#documents ⇒ Array<ShipmentDocument>
readonly
The shipment's documents.
-
#pickup_request_number ⇒ String
readonly
The shipment's pickup request number.
-
#pro_number ⇒ String
readonly
The shipment's PRO number.
Instance Method Summary collapse
-
#initialize(pro_number:, pickup_request_number: nil, documents: []) ⇒ ShipmentInformation
constructor
A new instance of ShipmentInformation.
-
#valid? ⇒ Boolean
Returns true if PRO number and pickup request number are present.
Constructor Details
#initialize(pro_number:, pickup_request_number: nil, documents: []) ⇒ ShipmentInformation
Returns a new instance of ShipmentInformation.
21 22 23 24 25 26 27 28 29 |
# File 'lib/friendly_shipping/services/rl/shipment_information.rb', line 21 def initialize( pro_number:, pickup_request_number: nil, documents: [] ) @pro_number = pro_number @pickup_request_number = pickup_request_number @documents = documents end |
Instance Attribute Details
#documents ⇒ Array<ShipmentDocument> (readonly)
Returns the shipment's documents.
16 17 18 |
# File 'lib/friendly_shipping/services/rl/shipment_information.rb', line 16 def documents @documents end |
#pickup_request_number ⇒ String (readonly)
Returns the shipment's pickup request number.
13 14 15 |
# File 'lib/friendly_shipping/services/rl/shipment_information.rb', line 13 def pickup_request_number @pickup_request_number end |
#pro_number ⇒ String (readonly)
Returns the shipment's PRO number.
10 11 12 |
# File 'lib/friendly_shipping/services/rl/shipment_information.rb', line 10 def pro_number @pro_number end |
Instance Method Details
#valid? ⇒ Boolean
Returns true if PRO number and pickup request number are present. Returns false if either of these values are missing.
35 36 37 |
# File 'lib/friendly_shipping/services/rl/shipment_information.rb', line 35 def valid? pro_number.present? && pickup_request_number.present? end |