Class: SimpleServiceProvider::Base
- Inherits:
-
Object
- Object
- SimpleServiceProvider::Base
- Extended by:
- ActiveModel::Callbacks
- Includes:
- ActiveModel::Validations, Virtus
- Defined in:
- lib/simple_service_provider/base.rb
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
19 20 21 |
# File 'lib/simple_service_provider/base.rb', line 19 def run raise NotImplementedError end |
#run! ⇒ Object
29 30 31 |
# File 'lib/simple_service_provider/base.rb', line 29 def run! run end |
#work(options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/simple_service_provider/base.rb', line 9 def work( = {}) run_callbacks :work do begin perform_validations() { run } rescue SimpleServiceProvider::RecordInvalid => ex $stdout.puts "The consultant could not perform the work because the following errors : " + ex. end end end |
#work!(options = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/simple_service_provider/base.rb', line 23 def work!( = {}) run_callbacks :work do perform_validations() { run! } end end |