Class: FriendlyShipping::Services::Usps::MachinablePackage

Inherits:
Object
  • Object
show all
Defined in:
lib/friendly_shipping/services/usps/machinable_package.rb

Overview

USPS has certain size and weight requirements for packages to be considered machinable. Machinable packages are generally less expensive to ship. For more information see: https://pe.usps.com/BusinessMail101?ViewName=Parcels

Constant Summary collapse

MIN_LENGTH =
Measured::Length(6, :inches)
MIN_WIDTH =
Measured::Length(3, :inches)
MIN_HEIGHT =
Measured::Length(0.25, :inches)
MAX_LENGTH =
Measured::Length(27, :inches)
MAX_WIDTH =
Measured::Length(17, :inches)
MAX_HEIGHT =
Measured::Length(17, :inches)
MAX_WEIGHT =
Measured::Weight(25, :pounds)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(package) ⇒ MachinablePackage

Returns a new instance of MachinablePackage.

Parameters:

  • package (Physical::Package)


25
26
27
# File 'lib/friendly_shipping/services/usps/machinable_package.rb', line 25

def initialize(package)
  @package = package
end

Instance Attribute Details

#packageObject (readonly)

Returns the value of attribute package.



12
13
14
# File 'lib/friendly_shipping/services/usps/machinable_package.rb', line 12

def package
  @package
end

Instance Method Details

#machinable?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/friendly_shipping/services/usps/machinable_package.rb', line 29

def machinable?
  at_least_minimum && at_most_maximum
end