Class: Assistant::Service
- Inherits:
-
Object
- Object
- Assistant::Service
- Includes:
- LogList
- Defined in:
- lib/assistant/service.rb
Overview
Base class for the Assistant gem
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Service
constructor
A new instance of Service.
- #run ⇒ Object
- #status ⇒ Object
Methods included from LogList
Constructor Details
#initialize(*args) ⇒ Service
Returns a new instance of Service.
14 15 16 17 |
# File 'lib/assistant/service.rb', line 14 def initialize(*args) @inputs = args @logs = [] end |
Class Method Details
.run(*args) ⇒ Object
9 10 11 |
# File 'lib/assistant/service.rb', line 9 def run(*args) new(*args).run end |
Instance Method Details
#run ⇒ Object
19 20 21 22 |
# File 'lib/assistant/service.rb', line 19 def run validate { result: execute, status: status, warnings: warnings } if errors.empty? end |
#status ⇒ Object
24 25 26 |
# File 'lib/assistant/service.rb', line 24 def status warnings.empty? ? :ok : :with_warnings end |