Class: Artisan::Stories::StorySorter

Inherits:
Object
  • Object
show all
Defined in:
lib/artisan/stories/story_sorter.rb

Instance Method Summary collapse

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

#sortObject



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