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

Inherits:
BaseValidator
  • Object
show all
Defined in:
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)


14
15
16
# File 'app/models/spree/return_item/eligibility_validator/default.rb', line 14

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

#errorsObject



22
23
24
# File 'app/models/spree/return_item/eligibility_validator/default.rb', line 22

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

#requires_manual_intervention?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/models/spree/return_item/eligibility_validator/default.rb', line 18

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