diff --git a/lib/uplot/plot.rb b/lib/uplot/plot.rb index 839917d..d726c8a 100644 --- a/lib/uplot/plot.rb +++ b/lib/uplot/plot.rb @@ -11,7 +11,7 @@ module Uplot headers = data.headers series = data.series if count - series = Preprocessing.count(series[0]) + series = Preprocessing.count_values(series[0]) params.title = headers[0] if headers end params.title ||= headers[1] if headers diff --git a/lib/uplot/preprocessing.rb b/lib/uplot/preprocessing.rb index 1edbaa3..f213e8c 100644 --- a/lib/uplot/preprocessing.rb +++ b/lib/uplot/preprocessing.rb @@ -71,7 +71,7 @@ module Uplot end end - def count(arr) + def count_values(arr) # tally was added in Ruby 2.7 if Enumerable.method_defined? :tally arr.tally