Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
return a string that represents increases, decreases, and stable changes in a method's length
# :: [event] -> String -> String
def method_delta_line es, method_name
es.select {|e| e.method_name == method_name }
.map(&:method_length)
.each_cons(2)
.map {|c,n| ["^","v","-"][(c <=> n) + 1] }
.join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment