Class: RobotLab::To::Decision

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#blockingObject (readonly)

Returns the value of attribute blocking

Returns:

  • (Object)

    the current value of blocking



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def blocking
  @blocking
end

#bodyObject (readonly)

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def body
  @body
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def created_at
  @created_at
end

#created_iterationObject (readonly)

Returns the value of attribute created_iteration

Returns:

  • (Object)

    the current value of created_iteration



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def created_iteration
  @created_iteration
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def id
  @id
end

#optionsObject (readonly)

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def path
  @path
end

#questionObject (readonly)

Returns the value of attribute question

Returns:

  • (Object)

    the current value of question



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def question
  @question
end

#recommendationObject (readonly)

Returns the value of attribute recommendation

Returns:

  • (Object)

    the current value of recommendation



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def recommendation
  @recommendation
end

#resolutionObject (readonly)

Returns the value of attribute resolution

Returns:

  • (Object)

    the current value of resolution



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def resolution
  @resolution
end

#resolved_atObject (readonly)

Returns the value of attribute resolved_at

Returns:

  • (Object)

    the current value of resolved_at



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def resolved_at
  @resolved_at
end

#situationObject (readonly)

Returns the value of attribute situation

Returns:

  • (Object)

    the current value of situation



15
16
17
# File 'lib/robot_lab/to/decision.rb', line 15

def situation
  @situation
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of 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).

Returns:

  • (Boolean)


37
# File 'lib/robot_lab/to/decision.rb', line 37

def answered? = resolved? && !resolution.to_s.strip.empty?

#blocking?Boolean

Returns:

  • (Boolean)


34
# File 'lib/robot_lab/to/decision.rb', line 34

def blocking?  = !!blocking

#closed?Boolean

Returns:

  • (Boolean)


32
# File 'lib/robot_lab/to/decision.rb', line 32

def closed?    = status.to_s == "closed"

#dismissed?Boolean

Returns:

  • (Boolean)


33
# File 'lib/robot_lab/to/decision.rb', line 33

def dismissed? = status.to_s == "dismissed"

#pending?Boolean

Returns:

  • (Boolean)


30
# File 'lib/robot_lab/to/decision.rb', line 30

def pending?   = status.to_s == "pending"

#resolved?Boolean

Returns:

  • (Boolean)


31
# File 'lib/robot_lab/to/decision.rb', line 31

def resolved?  = status.to_s == "resolved"