Method: UnicodePlot::ValueTransformer#transform_values
- Defined in:
- lib/unicode_plot/value_transformer.rb
#transform_values(func, values) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/unicode_plot/value_transformer.rb', line 12 def transform_values(func, values) return values unless func unless func.respond_to?(:call) func = PREDEFINED_TRANSFORM_FUNCTIONS[func] unless func.respond_to?(:call) raise ArgumentError, "func must be callable" end end case values when Numeric func.(values) else values.map(&func) end end |