Class: LogStash::ConvergeResult::ActionResult
- Inherits:
-
Object
- Object
- LogStash::ConvergeResult::ActionResult
- Defined in:
- lib/logstash/converge_result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#executed_at ⇒ Object
readonly
Returns the value of attribute executed_at.
Class Method Summary collapse
-
.create(action, action_result) ⇒ Object
Until all the action have more granularity in the validation or execution we make the ConvergeResult works with primitives and exceptions.
Instance Method Summary collapse
-
#initialize ⇒ ActionResult
constructor
A new instance of ActionResult.
Constructor Details
#initialize ⇒ ActionResult
Returns a new instance of ActionResult.
11 12 13 |
# File 'lib/logstash/converge_result.rb', line 11 def initialize @executed_at = LogStash::Timestamp.now end |
Instance Attribute Details
#executed_at ⇒ Object (readonly)
Returns the value of attribute executed_at.
9 10 11 |
# File 'lib/logstash/converge_result.rb', line 9 def executed_at @executed_at end |
Class Method Details
.create(action, action_result) ⇒ Object
Until all the action have more granularity in the validation or execution we make the ConvergeResult works with primitives and exceptions
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/logstash/converge_result.rb', line 17 def self.create(action, action_result) if action_result.is_a?(ActionResult) action_result elsif action_result.is_a?(Exception) FailedAction.from_exception(action_result) elsif action_result == true SuccessfulAction.new elsif action_result == false FailedAction.from_action(action, action_result) else raise LogStash::Error, "Don't know how to handle `#{action_result.class}` for `#{action}`" end end |