Module: JiraIssues::JiraIssueStats

Included in:
JiraIssuesNavigator
Defined in:
lib/jira_issues/jira_issues_stats.rb

Instance Method Summary collapse

Instance Method Details

#closed_by_weekObject



7
8
9
# File 'lib/jira_issues/jira_issues_stats.rb', line 7

def closed_by_week
    @issues.select { |i| !i[:closed_date].nil? }.map { |i| { key: i[:key], week_closed: Date.parse(i[:closed_date]).beginning_of_week } }.group_by { |x| x[:week_closed]}.map { |k, v| [k, v.count] }.to_h.sort
end

#created_by_weekObject



3
4
5
# File 'lib/jira_issues/jira_issues_stats.rb', line 3

def created_by_week
    @issues.map { |i| { key: i[:key], week_created: Date.parse(i[:created_date]).beginning_of_week } }.group_by { |x| x[:week_created]  }.map { |k, v| [k, v.count] }.to_h.sort
end