Class: FbaFeeCalculator::FbaFeeCalculation
- Inherits:
-
Object
- Object
- FbaFeeCalculator::FbaFeeCalculation
- Includes:
- ActiveModel::Model, FeeConstants
- Defined in:
- lib/fba_fee_calculator/fba_fee_calculation.rb
Constant Summary
Constants included from FeeConstants
FbaFeeCalculator::FeeConstants::MINIMUM_FEES, FbaFeeCalculator::FeeConstants::PERCENTAGE_FEES, FbaFeeCalculator::FeeConstants::PICK_PACK, FbaFeeCalculator::FeeConstants::VARIABLE_CLOSING_FEES
Instance Attribute Summary collapse
-
#amazon_referral_fee ⇒ Object
readonly
Returns the value of attribute amazon_referral_fee.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#cost_subtotal ⇒ Object
readonly
Returns the value of attribute cost_subtotal.
-
#cubic_feet ⇒ Object
readonly
Returns the value of attribute cubic_feet.
-
#dimensional_weight ⇒ Object
readonly
Returns the value of attribute dimensional_weight.
-
#dimensions ⇒ Object
readonly
Returns the value of attribute dimensions.
-
#fulfillment_cost_subtotal ⇒ Object
readonly
Returns the value of attribute fulfillment_cost_subtotal.
-
#is_media ⇒ Object
readonly
Returns the value of attribute is_media.
-
#margin_impact ⇒ Object
readonly
Returns the value of attribute margin_impact.
-
#monthly_storage ⇒ Object
readonly
Returns the value of attribute monthly_storage.
-
#order_handling ⇒ Object
readonly
Returns the value of attribute order_handling.
-
#outbound_shipping_weight ⇒ Object
readonly
Returns the value of attribute outbound_shipping_weight.
-
#packaging_weight ⇒ Object
readonly
Returns the value of attribute packaging_weight.
-
#pick_and_pack ⇒ Object
readonly
Returns the value of attribute pick_and_pack.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#revenue_subtotal ⇒ Object
readonly
Returns the value of attribute revenue_subtotal.
-
#size_category ⇒ Object
readonly
Returns the value of attribute size_category.
-
#size_tier ⇒ Object
readonly
Returns the value of attribute size_tier.
-
#variable_closing_fee ⇒ Object
readonly
Returns the value of attribute variable_closing_fee.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
-
#weight_handling ⇒ Object
readonly
Returns the value of attribute weight_handling.
Instance Method Summary collapse
- #calculate! ⇒ Object
-
#initialize(price, category, weight, dimensions) ⇒ FbaFeeCalculation
constructor
A new instance of FbaFeeCalculation.
Constructor Details
#initialize(price, category, weight, dimensions) ⇒ FbaFeeCalculation
Returns a new instance of FbaFeeCalculation.
16 17 18 19 20 21 22 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 16 def initialize(price, category, weight, dimensions) @price = price @category = category @weight = weight @dimensions = dimensions @fba_fees = FbaFees.new end |
Instance Attribute Details
#amazon_referral_fee ⇒ Object (readonly)
Returns the value of attribute amazon_referral_fee.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def amazon_referral_fee @amazon_referral_fee end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def category @category end |
#cost_subtotal ⇒ Object (readonly)
Returns the value of attribute cost_subtotal.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def cost_subtotal @cost_subtotal end |
#cubic_feet ⇒ Object (readonly)
Returns the value of attribute cubic_feet.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def cubic_feet @cubic_feet end |
#dimensional_weight ⇒ Object (readonly)
Returns the value of attribute dimensional_weight.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def dimensional_weight @dimensional_weight end |
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def dimensions @dimensions end |
#fulfillment_cost_subtotal ⇒ Object (readonly)
Returns the value of attribute fulfillment_cost_subtotal.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def fulfillment_cost_subtotal @fulfillment_cost_subtotal end |
#is_media ⇒ Object (readonly)
Returns the value of attribute is_media.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def is_media @is_media end |
#margin_impact ⇒ Object (readonly)
Returns the value of attribute margin_impact.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def margin_impact @margin_impact end |
#monthly_storage ⇒ Object (readonly)
Returns the value of attribute monthly_storage.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def monthly_storage @monthly_storage end |
#order_handling ⇒ Object (readonly)
Returns the value of attribute order_handling.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def order_handling @order_handling end |
#outbound_shipping_weight ⇒ Object (readonly)
Returns the value of attribute outbound_shipping_weight.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def outbound_shipping_weight @outbound_shipping_weight end |
#packaging_weight ⇒ Object (readonly)
Returns the value of attribute packaging_weight.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def packaging_weight @packaging_weight end |
#pick_and_pack ⇒ Object (readonly)
Returns the value of attribute pick_and_pack.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def pick_and_pack @pick_and_pack end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def price @price end |
#revenue_subtotal ⇒ Object (readonly)
Returns the value of attribute revenue_subtotal.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def revenue_subtotal @revenue_subtotal end |
#size_category ⇒ Object (readonly)
Returns the value of attribute size_category.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def size_category @size_category end |
#size_tier ⇒ Object (readonly)
Returns the value of attribute size_tier.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def size_tier @size_tier end |
#variable_closing_fee ⇒ Object (readonly)
Returns the value of attribute variable_closing_fee.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def variable_closing_fee @variable_closing_fee end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def weight @weight end |
#weight_handling ⇒ Object (readonly)
Returns the value of attribute weight_handling.
6 7 8 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 6 def weight_handling @weight_handling end |
Instance Method Details
#calculate! ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fba_fee_calculator/fba_fee_calculation.rb', line 24 def calculate! return unless valid? calculate_is_media calculate_size_category calculate_size_tier calculate_cubic_feet calculate_dimensional_weight calculate_packaging_weight calculate_outbound_shipping_weight calculate_revenue_subtotal calculate_amazon_referral_fee calculate_variable_closing_fee calculate_order_handling calculate_pick_and_pack calculate_weight_handling calculate_monthly_storage calculate_fulfillment_cost_subtotal calculate_cost_subtotal calculate_margin_impact self end |