Class: FriendlyShipping::Services::ShipEngine::LabelPackageOptions
- Inherits:
-
PackageOptions
- Object
- PackageOptions
- FriendlyShipping::Services::ShipEngine::LabelPackageOptions
- Defined in:
- lib/friendly_shipping/services/ship_engine/label_package_options.rb
Overview
Options relating to packages in the ShipEngine labels call
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
A list of messages to add to the label.
-
#package_code ⇒ Object
readonly
Returns the value of attribute package_code.
Attributes inherited from PackageOptions
Instance Method Summary collapse
-
#:package_code=(: package_code=(value)) ⇒ Object
The type of package.
-
#initialize(package_code: nil, messages: [], **kwargs) ⇒ LabelPackageOptions
constructor
A new instance of LabelPackageOptions.
Methods inherited from PackageOptions
Constructor Details
#initialize(package_code: nil, messages: [], **kwargs) ⇒ LabelPackageOptions
Returns a new instance of LabelPackageOptions.
20 21 22 23 24 |
# File 'lib/friendly_shipping/services/ship_engine/label_package_options.rb', line 20 def initialize(package_code: nil, messages: [], **kwargs) @package_code = package_code @messages = super(**kwargs) end |
Instance Attribute Details
#messages ⇒ Object (readonly)
A list of messages to add to the label. No carrier accepts more than three messages, and some have restrictions on how many characters are possible. We’re not validating here though.
17 18 19 20 21 22 23 24 25 |
# File 'lib/friendly_shipping/services/ship_engine/label_package_options.rb', line 17 class LabelPackageOptions < FriendlyShipping::PackageOptions attr_reader :package_code, :messages def initialize(package_code: nil, messages: [], **kwargs) @package_code = package_code @messages = super(**kwargs) end end |
#package_code ⇒ Object (readonly)
Returns the value of attribute package_code.
18 19 20 |
# File 'lib/friendly_shipping/services/ship_engine/label_package_options.rb', line 18 def package_code @package_code end |
Instance Method Details
#:package_code=(: package_code=(value)) ⇒ Object
The type of package. Possible types can be gotten via the ShipEngine API: www.shipengine.com/docs/reference/list-carrier-packages/ If a package type is given, no dimensions will be added to the call (as we can assume the carrier knows the dimensions of their packaging types).
17 18 19 20 21 22 23 24 25 |
# File 'lib/friendly_shipping/services/ship_engine/label_package_options.rb', line 17 class LabelPackageOptions < FriendlyShipping::PackageOptions attr_reader :package_code, :messages def initialize(package_code: nil, messages: [], **kwargs) @package_code = package_code @messages = super(**kwargs) end end |