Module: Rails::AddOns::Service::Base::Callbacks

Included in:
Rails::AddOns::Service::Base
Defined in:
app/services/rails/add_ons/service/base.rb

Instance Method Summary collapse

Instance Method Details

#after_initializeObject


51
# File 'app/services/rails/add_ons/service/base.rb', line 51

def after_initialize; end

#after_performObject


53
# File 'app/services/rails/add_ons/service/base.rb', line 53

def after_perform; end

#after_validationObject


55
# File 'app/services/rails/add_ons/service/base.rb', line 55

def after_validation; end

#before_performObject


52
# File 'app/services/rails/add_ons/service/base.rb', line 52

def before_perform; end

#before_validationObject


54
# File 'app/services/rails/add_ons/service/base.rb', line 54

def before_validation; end

#performObject


58
59
60
61
62
63
64
65
66
67
68
# File 'app/services/rails/add_ons/service/base.rb', line 58

def perform
  before_validation
  return perform_result unless valid?
  after_validation
  before_perform
  say "Performing" do
    _perform
  end
  after_perform
  perform_result
end