Class: FriendlyShipping::Services::UpsJson::LabelItemOptions
- Inherits:
-
ItemOptions
- Object
- ItemOptions
- FriendlyShipping::Services::UpsJson::LabelItemOptions
- Defined in:
- lib/friendly_shipping/services/ups_json/label_item_options.rb
Constant Summary collapse
- PRODUCT_UNIT_OF_MEASURE_CODES =
{ barrel: 'BA', bundle: 'BE', bag: 'BG', bunch: 'BH', box: 'BOX', bolt: 'BT', butt: 'BU', canister: 'CI', centimeter: 'CM', container: 'CON', crate: 'CR', case: 'CS', carton: 'CT', cylinder: 'CY', dozen: 'DOZ', each: 'EA', envelope: 'EN', feet: 'FT', kilogram: 'KG', kilograms: 'KGS', pound: 'LB', pounds: 'LBS', liter: 'L', meter: 'M', number: 'NMB', packet: 'PA', pallet: 'PAL', piece: 'PC', pieces: 'PCS', proof_liters: 'PF', package: 'PKG', pair: 'PR', pairs: 'PRS', roll: 'RL', set: 'SET', square_meters: 'SME', square_yards: 'SYD', tube: 'TU', yard: 'YD', other: 'OTH' }.freeze
Instance Attribute Summary collapse
-
#commodity_code ⇒ Object
readonly
Returns the value of attribute commodity_code.
-
#country_of_origin ⇒ Object
readonly
Returns the value of attribute country_of_origin.
Attributes inherited from ItemOptions
Instance Method Summary collapse
-
#initialize(commodity_code: nil, country_of_origin: nil, product_unit_of_measure: :number, **kwargs) ⇒ LabelItemOptions
constructor
A new instance of LabelItemOptions.
- #product_unit_of_measure_code ⇒ Object
Constructor Details
#initialize(commodity_code: nil, country_of_origin: nil, product_unit_of_measure: :number, **kwargs) ⇒ LabelItemOptions
Returns a new instance of LabelItemOptions.
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/friendly_shipping/services/ups_json/label_item_options.rb', line 53 def initialize( commodity_code: nil, country_of_origin: nil, product_unit_of_measure: :number, **kwargs ) @commodity_code = commodity_code @country_of_origin = country_of_origin @product_unit_of_measure = product_unit_of_measure super(**kwargs) end |
Instance Attribute Details
#commodity_code ⇒ Object (readonly)
Returns the value of attribute commodity_code.
50 51 52 |
# File 'lib/friendly_shipping/services/ups_json/label_item_options.rb', line 50 def commodity_code @commodity_code end |
#country_of_origin ⇒ Object (readonly)
Returns the value of attribute country_of_origin.
50 51 52 |
# File 'lib/friendly_shipping/services/ups_json/label_item_options.rb', line 50 def country_of_origin @country_of_origin end |
Instance Method Details
#product_unit_of_measure_code ⇒ Object
65 66 67 |
# File 'lib/friendly_shipping/services/ups_json/label_item_options.rb', line 65 def product_unit_of_measure_code PRODUCT_UNIT_OF_MEASURE_CODES[product_unit_of_measure] end |