Class: Lazylead::Task::Teammate
- Inherits:
-
Object
- Object
- Lazylead::Task::Teammate
- Extended by:
- Forwardable
- Defined in:
- lib/lazylead/task/loading.rb
Overview
The teammate’s tickets.
Instance Method Summary collapse
- #free? ⇒ Boolean
-
#initialize(user, tasks = []) ⇒ Teammate
constructor
A new instance of Teammate.
- #next ⇒ Object
- #sprints(*label) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(user, tasks = []) ⇒ Teammate
Returns a new instance of Teammate.
57 58 59 60 |
# File 'lib/lazylead/task/loading.rb', line 57 def initialize(user, tasks = []) @user = user @tasks = tasks end |
Instance Method Details
#free? ⇒ Boolean
62 63 64 65 |
# File 'lib/lazylead/task/loading.rb', line 62 def free? return true if @tasks.nil? @tasks.empty? end |
#next ⇒ Object
67 68 69 |
# File 'lib/lazylead/task/loading.rb', line 67 def next @tasks.reject { |t| t.duedate.nil? }.map { |t| t.duedate.to_date }.min end |
#sprints(*label) ⇒ Object
75 76 77 78 |
# File 'lib/lazylead/task/loading.rb', line 75 def sprints(*label) return @tasks.group_by(&:sprint).sort if label.empty? || label.nil? @tasks.group_by { |t| t.sprint(label) }.sort end |
#to_s ⇒ Object
71 72 73 |
# File 'lib/lazylead/task/loading.rb', line 71 def to_s "#{id} has #{total} tasks" end |