Class: FriendlyShipping::Services::RL::ShipmentDocument
- Inherits:
-
Object
- Object
- FriendlyShipping::Services::RL::ShipmentDocument
- Defined in:
- lib/friendly_shipping/services/rl/shipment_document.rb
Overview
Represents an R+L shipment document such as a BOL or shipping label.
Instance Attribute Summary collapse
-
#binary ⇒ String
readonly
The document's binary data.
-
#document_type ⇒ String
readonly
The type of document.
-
#format ⇒ String
readonly
The format of the document's binary data.
Instance Method Summary collapse
-
#initialize(format:, document_type:, binary:) ⇒ ShipmentDocument
constructor
A new instance of ShipmentDocument.
-
#valid? ⇒ Boolean
Returns true if format, document type, and binary data are all present.
Constructor Details
#initialize(format:, document_type:, binary:) ⇒ ShipmentDocument
Returns a new instance of ShipmentDocument.
20 21 22 23 24 25 26 27 28 |
# File 'lib/friendly_shipping/services/rl/shipment_document.rb', line 20 def initialize( format:, document_type:, binary: ) @format = format @document_type = document_type @binary = binary end |
Instance Attribute Details
#binary ⇒ String (readonly)
Returns the document's binary data.
15 16 17 |
# File 'lib/friendly_shipping/services/rl/shipment_document.rb', line 15 def binary @binary end |
#document_type ⇒ String (readonly)
Returns the type of document.
12 13 14 |
# File 'lib/friendly_shipping/services/rl/shipment_document.rb', line 12 def document_type @document_type end |
#format ⇒ String (readonly)
Returns the format of the document's binary data.
9 10 11 |
# File 'lib/friendly_shipping/services/rl/shipment_document.rb', line 9 def format @format end |
Instance Method Details
#valid? ⇒ Boolean
Returns true if format, document type, and binary data are all present. Returns false if any of these values are missing.
34 35 36 |
# File 'lib/friendly_shipping/services/rl/shipment_document.rb', line 34 def valid? format.present? && document_type.present? && binary.present? end |