Class: Spree::ReturnItem::EligibilityValidator::Default

Inherits:
BaseValidator
  • Object
show all
Defined in:
core/app/models/spree/return_item/eligibility_validator/default.rb

Instance Method Summary collapse

Methods inherited from BaseValidator

#initialize

Constructor Details

This class inherits a constructor from Spree::ReturnItem::EligibilityValidator::BaseValidator

Instance Method Details

#eligible_for_return?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'core/app/models/spree/return_item/eligibility_validator/default.rb', line 16

def eligible_for_return?
  validators.all?(&:eligible_for_return?)
end

#errorsObject



24
25
26
# File 'core/app/models/spree/return_item/eligibility_validator/default.rb', line 24

def errors
  validators.map(&:errors).reduce({}, :merge)
end

#requires_manual_intervention?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'core/app/models/spree/return_item/eligibility_validator/default.rb', line 20

def requires_manual_intervention?
  validators.any?(&:requires_manual_intervention?)
end