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.
56 57 58 59 |
# File 'lib/lazylead/task/loading.rb', line 56 def initialize(user, tasks = []) @user = user @tasks = tasks end |
Instance Method Details
#free? ⇒ Boolean
61 62 63 64 |
# File 'lib/lazylead/task/loading.rb', line 61 def free? return true if @tasks.nil? @tasks.empty? end |
#next ⇒ Object
66 67 68 |
# File 'lib/lazylead/task/loading.rb', line 66 def next @tasks.reject { |t| t.duedate.nil? }.map { |t| t.duedate.to_date }.min end |
#sprints(label) ⇒ Object
74 75 76 77 |
# File 'lib/lazylead/task/loading.rb', line 74 def sprints(label) return @tasks.group_by(&:sprint).sort if label.nil? || label.blank? @tasks.group_by { |t| t.sprint(label) }.sort end |
#to_s ⇒ Object
70 71 72 |
# File 'lib/lazylead/task/loading.rb', line 70 def to_s "#{id} has #{total} tasks" end |