Class: FriendlyShipping::Services::Ups::LabelPackageOptions
- Inherits:
-
PackageOptions
- Object
- PackageOptions
- FriendlyShipping::Services::Ups::LabelPackageOptions
- Defined in:
- lib/friendly_shipping/services/ups/label_package_options.rb
Overview
Package properties relevant for generating a UPS shipping label
Constant Summary collapse
- PACKAGE_DELIVERY_CONFIRMATION_CODES =
{ delivery_confirmation: 1, delivery_confirmation_signature_required: 2, delivery_confirmation_adult_signature_required: 3 }.freeze
Instance Attribute Summary collapse
-
#declared_value ⇒ Object
readonly
Returns the value of attribute declared_value.
-
#reference_numbers ⇒ Object
readonly
Returns the value of attribute reference_numbers.
-
#shipper_release ⇒ Object
readonly
Returns the value of attribute shipper_release.
Attributes inherited from PackageOptions
Instance Method Summary collapse
- #delivery_confirmation_code ⇒ Object
-
#initialize(reference_numbers: {}, delivery_confirmation: nil, shipper_release: false, declared_value: false, **kwargs) ⇒ LabelPackageOptions
constructor
A new instance of LabelPackageOptions.
Methods inherited from PackageOptions
Constructor Details
#initialize(reference_numbers: {}, delivery_confirmation: nil, shipper_release: false, declared_value: false, **kwargs) ⇒ LabelPackageOptions
Returns a new instance of LabelPackageOptions.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/friendly_shipping/services/ups/label_package_options.rb', line 25 def initialize( reference_numbers: {}, delivery_confirmation: nil, shipper_release: false, declared_value: false, **kwargs ) @reference_numbers = reference_numbers @delivery_confirmation = delivery_confirmation @shipper_release = shipper_release @declared_value = declared_value super(**kwargs.reverse_merge(item_options_class: LabelItemOptions)) end |
Instance Attribute Details
#declared_value ⇒ Object (readonly)
Returns the value of attribute declared_value.
23 24 25 |
# File 'lib/friendly_shipping/services/ups/label_package_options.rb', line 23 def declared_value @declared_value end |
#reference_numbers ⇒ Object (readonly)
Returns the value of attribute reference_numbers.
23 24 25 |
# File 'lib/friendly_shipping/services/ups/label_package_options.rb', line 23 def reference_numbers @reference_numbers end |
#shipper_release ⇒ Object (readonly)
Returns the value of attribute shipper_release.
23 24 25 |
# File 'lib/friendly_shipping/services/ups/label_package_options.rb', line 23 def shipper_release @shipper_release end |
Instance Method Details
#delivery_confirmation_code ⇒ Object
39 40 41 |
# File 'lib/friendly_shipping/services/ups/label_package_options.rb', line 39 def delivery_confirmation_code PACKAGE_DELIVERY_CONFIRMATION_CODES[delivery_confirmation] end |