Class: RobotLab::To::Decision
- Inherits:
-
Data
- Object
- Data
- RobotLab::To::Decision
- Defined in:
- lib/robot_lab/to/decision.rb
Overview
An immutable snapshot of one decision file on disk.
A decision is the artifact the robot writes when it hits a choice it
should not make autonomously: the situation, the options, and its own
recommended "lean". A human resolves it out-of-band by editing the file
(set status: resolved, fill resolution:); a later iteration reads the
resolution back in.
Status lifecycle: pending -> resolved (by human) -> closed (resolution
delivered to a robot and committed). dismissed is a terminal human veto.
Instance Attribute Summary collapse
-
#blocking ⇒ Object
readonly
Returns the value of attribute blocking.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#created_iteration ⇒ Object
readonly
Returns the value of attribute created_iteration.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#question ⇒ Object
readonly
Returns the value of attribute question.
-
#recommendation ⇒ Object
readonly
Returns the value of attribute recommendation.
-
#resolution ⇒ Object
readonly
Returns the value of attribute resolution.
-
#resolved_at ⇒ Object
readonly
Returns the value of attribute resolved_at.
-
#situation ⇒ Object
readonly
Returns the value of attribute situation.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#answered? ⇒ Boolean
True when a human has answered (resolved with a non-empty resolution).
- #blocking? ⇒ Boolean
- #closed? ⇒ Boolean
- #dismissed? ⇒ Boolean
- #pending? ⇒ Boolean
- #resolved? ⇒ Boolean
Instance Attribute Details
#blocking ⇒ Object (readonly)
Returns the value of attribute blocking
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def blocking @blocking end |
#body ⇒ Object (readonly)
Returns the value of attribute body
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def body @body end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def created_at @created_at end |
#created_iteration ⇒ Object (readonly)
Returns the value of attribute created_iteration
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def created_iteration @created_iteration end |
#id ⇒ Object (readonly)
Returns the value of attribute id
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def id @id end |
#options ⇒ Object (readonly)
Returns the value of attribute options
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def path @path end |
#question ⇒ Object (readonly)
Returns the value of attribute question
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def question @question end |
#recommendation ⇒ Object (readonly)
Returns the value of attribute recommendation
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def recommendation @recommendation end |
#resolution ⇒ Object (readonly)
Returns the value of attribute resolution
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def resolution @resolution end |
#resolved_at ⇒ Object (readonly)
Returns the value of attribute resolved_at
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def resolved_at @resolved_at end |
#situation ⇒ Object (readonly)
Returns the value of attribute situation
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def situation @situation end |
#status ⇒ Object (readonly)
Returns the value of attribute status
15 16 17 |
# File 'lib/robot_lab/to/decision.rb', line 15 def status @status end |
Instance Method Details
#answered? ⇒ Boolean
True when a human has answered (resolved with a non-empty resolution).
37 |
# File 'lib/robot_lab/to/decision.rb', line 37 def answered? = resolved? && !resolution.to_s.strip.empty? |
#blocking? ⇒ Boolean
34 |
# File 'lib/robot_lab/to/decision.rb', line 34 def blocking? = !!blocking |
#closed? ⇒ Boolean
32 |
# File 'lib/robot_lab/to/decision.rb', line 32 def closed? = status.to_s == "closed" |
#dismissed? ⇒ Boolean
33 |
# File 'lib/robot_lab/to/decision.rb', line 33 def dismissed? = status.to_s == "dismissed" |
#pending? ⇒ Boolean
30 |
# File 'lib/robot_lab/to/decision.rb', line 30 def pending? = status.to_s == "pending" |
#resolved? ⇒ Boolean
31 |
# File 'lib/robot_lab/to/decision.rb', line 31 def resolved? = status.to_s == "resolved" |