Module: CleanActions::FailWith::ClassMethods

Defined in:
lib/clean_actions/fail_with.rb

Instance Method Summary collapse

Instance Method Details

#dry_call(**kwargs) ⇒ Object



20
21
22
# File 'lib/clean_actions/fail_with.rb', line 20

def dry_call(**kwargs)
  new(**kwargs).dry_call
end

#fail_with(failure_reason, &block) ⇒ Object



16
17
18
# File 'lib/clean_actions/fail_with.rb', line 16

def fail_with(failure_reason, &block)
  before_actions { fail!(failure_reason) if instance_eval(&block) }
end