Module: GroupableIssueChart
- Defined in:
- lib/jirametrics/groupable_issue_chart.rb
Instance Method Summary collapse
- #group_issues(completed_issues) ⇒ Object
- #grouping_rules(&block) ⇒ Object
- #init_configuration_block(user_provided_block, &default_block) ⇒ Object
Instance Method Details
#group_issues(completed_issues) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/jirametrics/groupable_issue_chart.rb', line 18 def group_issues completed_issues result = {} completed_issues.each do |issue| rules = GroupingRules.new @group_by_block.call(issue, rules) next if rules.ignored? (result[rules] ||= []) << issue end result.each_key do |rules| rules.color = random_color if rules.color.nil? end result end |
#grouping_rules(&block) ⇒ Object
14 15 16 |
# File 'lib/jirametrics/groupable_issue_chart.rb', line 14 def grouping_rules &block @group_by_block = block end |
#init_configuration_block(user_provided_block, &default_block) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/jirametrics/groupable_issue_chart.rb', line 7 def init_configuration_block user_provided_block, &default_block instance_eval(&user_provided_block) return if @group_by_block instance_eval(&default_block) end |