Class: Edi::Amazon::JsonListingGenerator::Attributes::ItemPackageWeight

Inherits:
BaseUnitAttribute show all
Defined in:
app/services/edi/amazon/json_listing_generator/attributes/item_package_weight.rb

Overview

Service object: item package weight.

Constant Summary

Constants inherited from BaseAttribute

BaseAttribute::RUBY_UNIT_TO_AMAZON_UNIT

Instance Attribute Summary

Attributes inherited from BaseAttribute

#amazon_schema, #attribute_name, #catalog_item, #enum_mapper, #fba, #item, #language_tag, #marketplace, #marketplace_country_iso, #marketplace_id, #value_attribute_name, #variation

Instance Method Summary collapse

Methods inherited from BaseUnitAttribute

#build

Methods inherited from BaseAttribute

#build, #fetch_unit, #fetch_value, #initialize, #map_unit

Constructor Details

This class inherits a constructor from Edi::Amazon::JsonListingGenerator::Attributes::BaseAttribute

Instance Method Details

#unitObject



9
10
11
# File 'app/services/edi/amazon/json_listing_generator/attributes/item_package_weight.rb', line 9

def unit
  'pounds'
end

#valueObject



5
6
7
# File 'app/services/edi/amazon/json_listing_generator/attributes/item_package_weight.rb', line 5

def value
  [item.total_shipping_weight_converted, item.base_weight].max
end