Class: Artisan::Stories::StorySorter
- Inherits:
-
Object
- Object
- Artisan::Stories::StorySorter
- Defined in:
- lib/artisan/stories/story_sorter.rb
Instance Method Summary collapse
-
#initialize(project, state, story_ids, iteration) ⇒ StorySorter
constructor
A new instance of StorySorter.
- #sort ⇒ Object
Constructor Details
#initialize(project, state, story_ids, iteration) ⇒ StorySorter
Returns a new instance of StorySorter.
7 8 9 10 11 12 |
# File 'lib/artisan/stories/story_sorter.rb', line 7 def initialize(project, state, story_ids, iteration) @state = state @story_ids = story_ids @iteration = iteration @project = project end |
Instance Method Details
#sort ⇒ Object
14 15 16 17 18 19 |
# File 'lib/artisan/stories/story_sorter.rb', line 14 def sort get_stories.each do |story| story.position = story_index(story) if has_story_id?(story) Artisan::Repository.story.save(story) end end |