mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-09-17 00:28:11 +08:00
Add test count_values_non_tally
This commit is contained in:
@@ -6,9 +6,9 @@ module YouPlot
|
||||
module Processing
|
||||
module_function
|
||||
|
||||
def count_values(arr)
|
||||
def count_values(arr, tally: true)
|
||||
# tally was added in Ruby 2.7
|
||||
if Enumerable.method_defined? :tally
|
||||
if tally && Enumerable.method_defined?(:tally)
|
||||
arr.tally
|
||||
else
|
||||
# https://github.com/marcandre/backports
|
||||
|
Reference in New Issue
Block a user