Class: TrackerFetchedMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/tracker_fetched_mapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(renderer, tracker_connector) ⇒ TrackerFetchedMapper

Returns a new instance of TrackerFetchedMapper.



3
4
5
6
# File 'lib/tracker_fetched_mapper.rb', line 3

def initialize(renderer, tracker_connector)
  @renderer = renderer
  @tracker = tracker_connector
end

Instance Method Details

#execute(story_commit) ⇒ Object



8
9
10
11
# File 'lib/tracker_fetched_mapper.rb', line 8

def execute(story_commit)
  map = map(story_commit)
  @renderer.render(map)
end

#map(story_commit) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/tracker_fetched_mapper.rb', line 13

def map(story_commit)
  {}.tap do |h|
    @tracker.details_for(story_commit.keys).each do |story, project_state|
      h[story_commit[story]] = {'story' => story, 'state' => project_state[1], 'project' => project_state[0]}
    end
  end
end