module Scale
Helper for scaling numbers
Constants
- VERSION
Public Instance Methods
from(source)
click to toggle source
Build a scaling scheme starting with the given source @param [::Enumerable] source @return [Scale::Scheme]
# File lib/scale/scheme.rb, line 16 def from(source) Scheme.new.from(source) end
to(destination)
click to toggle source
Build a scaling scheme starting with the given destination @param [::Enumerable] destination @return [Scale::Scheme]
# File lib/scale/scheme.rb, line 23 def to(destination) Scheme.new.to(destination) end
transform(input)
click to toggle source
Build a scaling scheme for the given input @param [Numeric] input @return [Scale::Scheme]
# File lib/scale/scheme.rb, line 8 def transform(input) Scheme.new.scale(input) end
Also aliased as: scale
using(source, destination)
click to toggle source
Build a scaling scheme starting with the given source and destination @param [::Enumerable] source @param [::Enumerable] destination @return [Scale::Scheme]
# File lib/scale/scheme.rb, line 31 def using(source, destination) Scheme.new.using(source, destination) end