Module: ServiceActor::Failable::ClassMethods

Defined in:
lib/service_actor/failable.rb

Instance Method Summary collapse

Instance Method Details

#fail_on(*exceptions) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/service_actor/failable.rb', line 24

def fail_on(*exceptions)
  exceptions.each do |exception|
    ServiceActor::ArgumentsValidator.validate_error_class(exception)
  end

  fail_ons.push(*exceptions)
end

#fail_onsObject



32
33
34
# File 'lib/service_actor/failable.rb', line 32

def fail_ons
  @fail_ons ||= []
end

#inherited(child) ⇒ Object



18
19
20
21
22
# File 'lib/service_actor/failable.rb', line 18

def inherited(child)
  super

  child.fail_ons.push(*fail_ons)
end