Class: Light::Services::Base
- Inherits:
-
Object
- Object
- Light::Services::Base
- Includes:
- Callbacks, Outputs, Parameters
- Defined in:
- lib/light/services/base.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Getters.
-
#warnings ⇒ Object
readonly
Getters.
Attributes included from Outputs
Attributes included from Parameters
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 Outputs
Methods included from Parameters
Constructor Details
Instance Attribute Details
#errors ⇒ Object (readonly)
Getters
12 13 14 |
# File 'lib/light/services/base.rb', line 12 def errors @errors end |
#warnings ⇒ Object (readonly)
Getters
12 13 14 |
# File 'lib/light/services/base.rb', line 12 def warnings @warnings end |
Class Method Details
.call(args = {}) ⇒ Object Also known as: run
37 38 39 |
# File 'lib/light/services/base.rb', line 37 def call(args = {}) new(args).tap(&:call) end |
Instance Method Details
#any_warnings? ⇒ Boolean
32 33 34 |
# File 'lib/light/services/base.rb', line 32 def any_warnings? warnings.any? end |
#call ⇒ Object
24 25 26 |
# File 'lib/light/services/base.rb', line 24 def call run_service end |
#success? ⇒ Boolean
28 29 30 |
# File 'lib/light/services/base.rb', line 28 def success? errors.blank? end |