Class: FriendlyShipping::Services::UspsInternational::RateEstimatePackageOptions
- Inherits:
-
PackageOptions
- Object
- PackageOptions
- FriendlyShipping::Services::UspsInternational::RateEstimatePackageOptions
- Defined in:
- lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb
Instance Attribute Summary collapse
-
#box_name ⇒ Object
readonly
Returns the value of attribute box_name.
-
#commercial_plus_pricing ⇒ Object
readonly
Returns the value of attribute commercial_plus_pricing.
-
#commercial_pricing ⇒ Object
readonly
Returns the value of attribute commercial_pricing.
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#mail_type ⇒ Object
readonly
Returns the value of attribute mail_type.
-
#rectangular ⇒ Object
readonly
Returns the value of attribute rectangular.
-
#shipping_method ⇒ Object
readonly
Returns the value of attribute shipping_method.
-
#transmit_dimensions ⇒ Object
readonly
Returns the value of attribute transmit_dimensions.
Attributes inherited from PackageOptions
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ RateEstimatePackageOptions
constructor
A new instance of RateEstimatePackageOptions.
Methods inherited from PackageOptions
Constructor Details
#initialize(**kwargs) ⇒ RateEstimatePackageOptions
Returns a new instance of RateEstimatePackageOptions.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 26 def initialize(**kwargs) container_code = value_or_default(:container, :variable, kwargs) || :variable mail_type_code = value_or_default(:mail_type, :all, kwargs) || :all @box_name = value_or_default(:box_name, :variable, kwargs) @commercial_pricing = value_or_default(:commercial_pricing, false, kwargs) ? 'Y' : 'N' @commercial_plus_pricing = value_or_default(:commercial_plus_pricing, false, kwargs) ? 'Y' : 'N' @container = CONTAINERS.fetch(container_code) @mail_type = MAIL_TYPES.fetch(mail_type_code) @rectangular = @container.eql?("ROLL") ? false : value_or_default(:rectangular, true, kwargs) @shipping_method = kwargs.delete(:shipping_method) @transmit_dimensions = value_or_default(:transmit_dimensions, true, kwargs) super(**kwargs) end |
Instance Attribute Details
#box_name ⇒ Object (readonly)
Returns the value of attribute box_name.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def box_name @box_name end |
#commercial_plus_pricing ⇒ Object (readonly)
Returns the value of attribute commercial_plus_pricing.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def commercial_plus_pricing @commercial_plus_pricing end |
#commercial_pricing ⇒ Object (readonly)
Returns the value of attribute commercial_pricing.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def commercial_pricing @commercial_pricing end |
#container ⇒ Object (readonly)
Returns the value of attribute container.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def container @container end |
#mail_type ⇒ Object (readonly)
Returns the value of attribute mail_type.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def mail_type @mail_type end |
#rectangular ⇒ Object (readonly)
Returns the value of attribute rectangular.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def rectangular @rectangular end |
#shipping_method ⇒ Object (readonly)
Returns the value of attribute shipping_method.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def shipping_method @shipping_method end |
#transmit_dimensions ⇒ Object (readonly)
Returns the value of attribute transmit_dimensions.
17 18 19 |
# File 'lib/friendly_shipping/services/usps_international/rate_estimate_package_options.rb', line 17 def transmit_dimensions @transmit_dimensions end |