Class: Brownie::Package
- Inherits:
-
Object
- Object
- Brownie::Package
- Defined in:
- lib/brownie/package.rb
Constant Summary collapse
- LETTER =
"01"
- CUSTOMER_SUPPLIED_PACKAGE =
"02"
- TUBE =
"03"
- PAK =
"04"
- UPS_EXPRESS_BOX =
"21"
- UPS_25KG_BOX =
"24"
- UPS_10KG_BOX =
"25"
- PALLET =
"30"
- SMALL_EXPRESS_BOX =
"2a"
- MEDIUM_EXPRESS_BOX =
"2b"
- LARGE_EXPRESS_BOX =
"2c"
- FLATS =
"56"
- PARCELS =
"57"
- BPM =
"58"
- FIRST_CLASS =
"59"
- PRIORITY =
"60"
- MACHINABLES =
"61"
- IRREGULARS =
"62"
- PARCEL_POST =
"63"
- BPM_PARCEL =
"64"
- MEDIA_MAIL =
"65"
- BPM_FLAT =
"66"
- STANDARD_FLAT =
"67"
Instance Attribute Summary collapse
-
#declared_value ⇒ Object
Returns the value of attribute declared_value.
-
#height ⇒ Object
Returns the value of attribute height.
-
#length ⇒ Object
Returns the value of attribute length.
-
#package_type ⇒ Object
Returns the value of attribute package_type.
-
#unit_of_measurement ⇒ Object
Returns the value of attribute unit_of_measurement.
-
#weight ⇒ Object
Returns the value of attribute weight.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
Instance Attribute Details
#declared_value ⇒ Object
Returns the value of attribute declared_value.
29 30 31 |
# File 'lib/brownie/package.rb', line 29 def declared_value @declared_value end |
#height ⇒ Object
Returns the value of attribute height.
29 30 31 |
# File 'lib/brownie/package.rb', line 29 def height @height end |
#length ⇒ Object
Returns the value of attribute length.
29 30 31 |
# File 'lib/brownie/package.rb', line 29 def length @length end |
#package_type ⇒ Object
Returns the value of attribute package_type.
29 30 31 |
# File 'lib/brownie/package.rb', line 29 def package_type @package_type end |
#unit_of_measurement ⇒ Object
Returns the value of attribute unit_of_measurement.
29 30 31 |
# File 'lib/brownie/package.rb', line 29 def unit_of_measurement @unit_of_measurement end |
#weight ⇒ Object
Returns the value of attribute weight.
29 30 31 |
# File 'lib/brownie/package.rb', line 29 def weight @weight end |
#width ⇒ Object
Returns the value of attribute width.
29 30 31 |
# File 'lib/brownie/package.rb', line 29 def width @width end |
Instance Method Details
#create ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/brownie/package.rb', line 32 def create data = Hash.from_xml(template)["Package"] data["PackagingType"]["Code"] = self.package_type data["PackageServiceOptions"]["InsuredValue"]["MonetaryValue"] = self.declared_value.to_s data["PackageWeight"]["Weight"] = self.weight.nil? ? 1.0.to_s : self.weight.to_s data["Dimensions"]["UnitOfMeasurement"]["Code"] = self.unit_of_measurement data["Dimensions"]["Length"] = self.length data["Dimensions"]["Width"] = self.width data["Dimensions"]["Height"] = self.height return data end |