Class: Ace::Overseer::Models::WorkContext
- Inherits:
-
Object
- Object
- Ace::Overseer::Models::WorkContext
- Defined in:
- lib/ace/overseer/models/work_context.rb
Instance Attribute Summary collapse
-
#assignments ⇒ Object
readonly
Returns the value of attribute assignments.
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#git_status ⇒ Object
readonly
Returns the value of attribute git_status.
-
#location_type ⇒ Object
readonly
Returns the value of attribute location_type.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
-
#tmux_window ⇒ Object
readonly
Returns the value of attribute tmux_window.
-
#worktree_path ⇒ Object
readonly
Returns the value of attribute worktree_path.
Instance Method Summary collapse
- #assignment_count ⇒ Object
- #assignment_status ⇒ Object
-
#initialize(task_id:, worktree_path:, branch:, assignments: [], git_status: nil, tmux_window: nil, location_type: :worktree) ⇒ WorkContext
constructor
A new instance of WorkContext.
- #to_h ⇒ Object
Constructor Details
#initialize(task_id:, worktree_path:, branch:, assignments: [], git_status: nil, tmux_window: nil, location_type: :worktree) ⇒ WorkContext
Returns a new instance of WorkContext.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ace/overseer/models/work_context.rb', line 10 def initialize(task_id:, worktree_path:, branch:, assignments: [], git_status: nil, tmux_window: nil, location_type: :worktree) @task_id = task_id.to_s.freeze @worktree_path = worktree_path.to_s.freeze @branch = branch.to_s.freeze @assignments = Array(assignments) @git_status = git_status @tmux_window = tmux_window&.to_s&.freeze @location_type = location_type.to_sym end |
Instance Attribute Details
#assignments ⇒ Object (readonly)
Returns the value of attribute assignments.
7 8 9 |
# File 'lib/ace/overseer/models/work_context.rb', line 7 def assignments @assignments end |
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
7 8 9 |
# File 'lib/ace/overseer/models/work_context.rb', line 7 def branch @branch end |
#git_status ⇒ Object (readonly)
Returns the value of attribute git_status.
7 8 9 |
# File 'lib/ace/overseer/models/work_context.rb', line 7 def git_status @git_status end |
#location_type ⇒ Object (readonly)
Returns the value of attribute location_type.
7 8 9 |
# File 'lib/ace/overseer/models/work_context.rb', line 7 def location_type @location_type end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
7 8 9 |
# File 'lib/ace/overseer/models/work_context.rb', line 7 def task_id @task_id end |
#tmux_window ⇒ Object (readonly)
Returns the value of attribute tmux_window.
7 8 9 |
# File 'lib/ace/overseer/models/work_context.rb', line 7 def tmux_window @tmux_window end |
#worktree_path ⇒ Object (readonly)
Returns the value of attribute worktree_path.
7 8 9 |
# File 'lib/ace/overseer/models/work_context.rb', line 7 def worktree_path @worktree_path end |
Instance Method Details
#assignment_count ⇒ Object
25 26 27 |
# File 'lib/ace/overseer/models/work_context.rb', line 25 def assignment_count @assignments.size end |
#assignment_status ⇒ Object
21 22 23 |
# File 'lib/ace/overseer/models/work_context.rb', line 21 def assignment_status @assignments.first end |
#to_h ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ace/overseer/models/work_context.rb', line 29 def to_h { task_id: task_id, worktree_path: worktree_path, branch: branch, assignments: assignments, git_status: git_status, tmux_window: tmux_window, location_type: location_type } end |