Module: Scale
- Extended by:
- Scale
- Included in:
- Scale
- Defined in:
- lib/scale.rb,
lib/scale/scheme.rb,
lib/scale/source.rb,
lib/scale/destination.rb
Overview
Helper for scaling numbers
Defined Under Namespace
Modules: Destination, Source Classes: Scheme
Constant Summary collapse
- VERSION =
"0.4.2"
Instance Method Summary collapse
-
#from(source) ⇒ Scale::Scheme
Build a scaling scheme starting with the given source.
-
#to(destination) ⇒ Scale::Scheme
Build a scaling scheme starting with the given destination.
-
#transform(input) ⇒ Scale::Scheme
(also: #scale)
Build a scaling scheme for the given input.
-
#using(source, destination) ⇒ Scale::Scheme
Build a scaling scheme starting with the given source and destination.
Instance Method Details
#from(source) ⇒ Scale::Scheme
Build a scaling scheme starting with the given source
16 17 18 |
# File 'lib/scale/scheme.rb', line 16 def from(source) Scheme.new.from(source) end |
#to(destination) ⇒ Scale::Scheme
Build a scaling scheme starting with the given destination
23 24 25 |
# File 'lib/scale/scheme.rb', line 23 def to(destination) Scheme.new.to(destination) end |
#transform(input) ⇒ Scale::Scheme Also known as: scale
Build a scaling scheme for the given input
8 9 10 |
# File 'lib/scale/scheme.rb', line 8 def transform(input) Scheme.new.scale(input) end |
#using(source, destination) ⇒ Scale::Scheme
Build a scaling scheme starting with the given source and destination
31 32 33 |
# File 'lib/scale/scheme.rb', line 31 def using(source, destination) Scheme.new.using(source, destination) end |