Class: Light::Services::Base
- Inherits:
-
Object
- Object
- Light::Services::Base
- Includes:
- Callbacks, Parameters
- Defined in:
- lib/light/services/base.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Getters.
-
#warnings ⇒ Object
readonly
Getters.
Class Method Summary collapse
- .call(args = {}) ⇒ Object (also: run)
Instance Method Summary collapse
- #any_warnings? ⇒ Boolean
- #call ⇒ Object
-
#initialize(args = {}) ⇒ Base
constructor
A new instance of Base.
- #success? ⇒ Boolean
Methods included from Callbacks
Methods included from Parameters
included, #outputs, #parameters
Constructor Details
Instance Attribute Details
#errors ⇒ Object (readonly)
Getters
9 10 11 |
# File 'lib/light/services/base.rb', line 9 def errors @errors end |
#warnings ⇒ Object (readonly)
Getters
9 10 11 |
# File 'lib/light/services/base.rb', line 9 def warnings @warnings end |
Class Method Details
.call(args = {}) ⇒ Object Also known as: run
34 35 36 37 38 |
# File 'lib/light/services/base.rb', line 34 def call(args = {}) service = new(args) service.call service end |
Instance Method Details
#any_warnings? ⇒ Boolean
29 30 31 |
# File 'lib/light/services/base.rb', line 29 def any_warnings? warnings.any? end |
#call ⇒ Object
21 22 23 |
# File 'lib/light/services/base.rb', line 21 def call run_service end |
#success? ⇒ Boolean
25 26 27 |
# File 'lib/light/services/base.rb', line 25 def success? errors.blank? end |