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

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

Direct Known Subclasses

ReturnItem::EligibilityValidator::Default, ReturnItem::EligibilityValidator::InventoryShipped, ReturnItem::EligibilityValidator::NoReimbursements, ReturnItem::EligibilityValidator::OrderCompleted, ReturnItem::EligibilityValidator::RMARequired, ReturnItem::EligibilityValidator::TimeSincePurchase

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (BaseValidator) initialize(return_item)

Returns a new instance of BaseValidator



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

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

Instance Attribute Details

- (Object) errors (readonly)

Returns the value of attribute errors



3
4
5
# File 'app/models/spree/return_item/eligibility_validator/base_validator.rb', line 3

def errors
  @errors
end

Instance Method Details

- (Boolean) eligible_for_return?

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


10
11
12
# File 'app/models/spree/return_item/eligibility_validator/base_validator.rb', line 10

def eligible_for_return?
  raise NotImplementedError, Spree.t(:implement_eligible_for_return)
end

- (Boolean) requires_manual_intervention?

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def requires_manual_intervention?
  raise NotImplementedError, Spree.t(:implement_requires_manual_intervention)
end