Class: SolidusEasypost::Calculator::BaseDimensionCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/solidus_easypost/calculator/base_dimension_calculator.rb

Direct Known Subclasses

WeightDimensionCalculator

Instance Method Summary collapse

Instance Method Details

#compute(resource) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/solidus_easypost/calculator/base_dimension_calculator.rb', line 6

def compute(resource)
  case resource
  when ::SolidusEasypost::ReturnAuthorization
    compute_for_return_authorization(resource)
  when ::Spree::Stock::Package
    compute_for_package(resource)
  else
    raise SolidusEasypost::Errors::UnknownPartialResourceError
  end
end