Class: Artisan::StoryColumnChanger
- Inherits:
-
Object
- Object
- Artisan::StoryColumnChanger
- Defined in:
- lib/artisan/story_column_changer.rb
Instance Method Summary collapse
-
#initialize(story, user) ⇒ StoryColumnChanger
constructor
A new instance of StoryColumnChanger.
- #move_to_backlog ⇒ Object
- #move_to_completed(user, iteration, options = {}) ⇒ Object
- #move_to_ready(iteration) ⇒ Object
- #move_to_working(user, iteration) ⇒ Object
Constructor Details
#initialize(story, user) ⇒ StoryColumnChanger
Returns a new instance of StoryColumnChanger.
7 8 9 10 |
# File 'lib/artisan/story_column_changer.rb', line 7 def initialize(story, user) @story = story @user = user end |
Instance Method Details
#move_to_backlog ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/artisan/story_column_changer.rb', line 12 def move_to_backlog clear_completed clear_working story_repository.remove_from_iteration(@story) story_repository.save(@story) Artisan::Activity::StoryAuditor::backlogged(@story.id, @story.project.id, @user.id) end |
#move_to_completed(user, iteration, options = {}) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/artisan/story_column_changer.rb', line 42 def move_to_completed(user, iteration, = {}) story_repository.add_to_iteration(iteration, @story) @story.assigned_user ||= user @story.complete = true @story.completed_at = DateTime.now story_repository.save(@story) [:event_mailer].completed_story(@story) if ![:event_mailer].nil? Artisan::Activity::StoryAuditor::completed(@story.id, @story.project.id, @user.id) end |
#move_to_ready(iteration) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/artisan/story_column_changer.rb', line 22 def move_to_ready(iteration) clear_completed clear_working story_repository.add_to_iteration(iteration, @story) story_repository.save(@story) Artisan::Activity::StoryAuditor::readied(@story.id, @story.project.id, @user.id) end |
#move_to_working(user, iteration) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/artisan/story_column_changer.rb', line 32 def move_to_working(user, iteration) clear_completed story_repository.add_to_iteration(iteration, @story) @story.assigned_user ||= user story_repository.save(@story) Artisan::Activity::StoryAuditor::worked(@story.id, @story.project.id, @user.id) end |