Class: ReturnItem::EligibilityValidator::Default

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

Instance Method Summary collapse

Instance Method Details

#eligible_for_return?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'app/models/spree/return_item/eligibility_validator/default.rb', line 12

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

#errorsObject


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

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

#requires_manual_intervention?Boolean

Returns:

  • (Boolean)

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

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