Class: Spree::ReturnItem::EligibilityValidator::BaseValidator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(return_item) ⇒ BaseValidator

Returns a new instance of BaseValidator



7
8
9
10
# File 'app/models/spree/return_item/eligibility_validator/base_validator.rb', line 7

def initialize(return_item)
  @return_item = return_item
  @errors = {}
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors



5
6
7
# File 'app/models/spree/return_item/eligibility_validator/base_validator.rb', line 5

def errors
  @errors
end

Instance Method Details

#eligible_for_return?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def eligible_for_return?
  raise NotImplementedError, I18n.t('spree.implement_eligible_for_return')
end

#requires_manual_intervention?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def requires_manual_intervention?
  raise NotImplementedError, I18n.t('spree.implement_requires_manual_intervention')
end