Class: Spree::DeliveryMethodRule

Inherits:
Object
  • Object
show all
Includes:
PreferenceSchema, TypeLabels
Defined in:
app/models/spree/delivery_method_rule.rb

Overview

Eligibility constraint on a delivery method, evaluated against the stock package in the Estimator's method filter — the single seam every rate consumer flows through, so calculator- and provider-priced methods obey the same rules. AND semantics across a method's active rules; a method with no rules is eligible everywhere. See docs/plans/6.0-delivery-method-rules.md.

Instance Method Summary collapse

Methods included from TypeLabels

#human_description, #human_name

Methods included from PreferenceSchema

#serialized_preferences

Instance Method Details

#eligible?(_package) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


35
36
37
# File 'app/models/spree/delivery_method_rule.rb', line 35

def eligible?(_package)
  raise NotImplementedError, "Please implement 'eligible?(package)' in your rule: #{self.class.name}"
end