Class: SprintTaskPresenter
- Inherits:
-
TaskPresenter
- Object
- TaskPresenter
- SprintTaskPresenter
- Defined in:
- app/presenters/sprint_task_presenter.rb
Instance Attribute Summary collapse
-
#ends_at ⇒ Object
readonly
Returns the value of attribute ends_at.
-
#sprint ⇒ Object
readonly
Returns the value of attribute sprint.
Attributes inherited from TaskPresenter
Instance Method Summary collapse
-
#initialize(sprint, tasks = sprint.tasks) ⇒ SprintTaskPresenter
constructor
A new instance of SprintTaskPresenter.
- #task_to_json(task) ⇒ Object
Methods inherited from TaskPresenter
Methods included from UrlHelper
#edit_release_path, #edit_release_url, #feature_path, #github_commit_range_url, #github_commit_url, #github_project_url, #github_url?, #goldmine_case_number_url, #link_to_project_feature, #new_release_url, #release_path, #release_url, #releases_path
Constructor Details
#initialize(sprint, tasks = sprint.tasks) ⇒ SprintTaskPresenter
Returns a new instance of SprintTaskPresenter.
4 5 6 7 8 |
# File 'app/presenters/sprint_task_presenter.rb', line 4 def initialize(sprint, tasks=sprint.tasks) @sprint = sprint @ends_at = sprint.end_date.end_of_day super tasks end |
Instance Attribute Details
#ends_at ⇒ Object (readonly)
Returns the value of attribute ends_at.
2 3 4 |
# File 'app/presenters/sprint_task_presenter.rb', line 2 def ends_at @ends_at end |
#sprint ⇒ Object (readonly)
Returns the value of attribute sprint.
2 3 4 |
# File 'app/presenters/sprint_task_presenter.rb', line 2 def sprint @sprint end |
Instance Method Details
#task_to_json(task) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/presenters/sprint_task_presenter.rb', line 10 def task_to_json(task) super.merge( released: task.first_release_at && task.first_release_at < ends_at, committed: task.first_commit_at && task.first_commit_at < ends_at, completed: task.completed_at && task.completed_at < ends_at, checkedOutAt: checked_out_at(task), checkedOutBy: checked_out_by(task)) end |