class Hiptest::NodeModifiers::AnnotationsCounter
Public Class Methods
new()
click to toggle source
# File lib/hiptest-publisher/node_modifiers/gherkin_adder.rb, line 229 def initialize @counts_by_actionword = Hash.new {|counts, actionword| counts[actionword] = Hash.new(0) } end
Public Instance Methods
actionwords()
click to toggle source
# File lib/hiptest-publisher/node_modifiers/gherkin_adder.rb, line 233 def actionwords @counts_by_actionword.keys end
all_used_annotations(actionword)
click to toggle source
# File lib/hiptest-publisher/node_modifiers/gherkin_adder.rb, line 247 def all_used_annotations(actionword) @counts_by_actionword[actionword].keys end
increment(actionword, annotation)
click to toggle source
# File lib/hiptest-publisher/node_modifiers/gherkin_adder.rb, line 237 def increment(actionword, annotation) counts = @counts_by_actionword[actionword] counts[annotation] += 1 if annotation end
most_used_annotation(actionword)
click to toggle source
# File lib/hiptest-publisher/node_modifiers/gherkin_adder.rb, line 242 def most_used_annotation(actionword) max = @counts_by_actionword[actionword].values.max @counts_by_actionword[actionword].key(max) end