Class: Artisan::Projects::ProjectsPresenter
- Inherits:
-
Object
- Object
- Artisan::Projects::ProjectsPresenter
- Defined in:
- lib/artisan/projects/projects_presenter.rb
Instance Method Summary collapse
- #active_points ⇒ Object
- #active_stories_by_project ⇒ Object
-
#archived ⇒ Object
TODO - PWP - optimize this method to use sql to create the returns rather than ruby.
-
#current ⇒ Object
TODO - PWP - optimize this method to use sql to create the returns rather than ruby.
-
#initialize(user) ⇒ ProjectsPresenter
constructor
A new instance of ProjectsPresenter.
Constructor Details
#initialize(user) ⇒ ProjectsPresenter
Returns a new instance of ProjectsPresenter.
8 9 10 |
# File 'lib/artisan/projects/projects_presenter.rb', line 8 def initialize(user) @user = user end |
Instance Method Details
#active_points ⇒ Object
26 27 28 |
# File 'lib/artisan/projects/projects_presenter.rb', line 26 def active_points Stories::StoryCollection.new(active_stories).estimated_points end |
#active_stories_by_project ⇒ Object
22 23 24 |
# File 'lib/artisan/projects/projects_presenter.rb', line 22 def active_stories_by_project active_stories.group_by(&:project) end |
#archived ⇒ Object
TODO - PWP - optimize this method to use sql to create the returns rather than ruby
13 14 15 |
# File 'lib/artisan/projects/projects_presenter.rb', line 13 def archived read_attributes_to_hash(@user.projects.archived) end |
#current ⇒ Object
TODO - PWP - optimize this method to use sql to create the returns rather than ruby
18 19 20 |
# File 'lib/artisan/projects/projects_presenter.rb', line 18 def current read_attributes_to_hash(@user.projects.unarchived) end |