Class: Fusuma::Plugin::Detectors::PinchDetector::Quantity
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Detectors::PinchDetector::Quantity
- Defined in:
- lib/fusuma/plugin/detectors/pinch_detector.rb
Overview
quantity of gesture
Instance Method Summary collapse
-
#calc ⇒ Object
: () -> Float.
-
#initialize(target:, base:) ⇒ Quantity
constructor
: (target: Float, base: Float) -> void.
-
#to_f ⇒ Object
: () -> Float.
Constructor Details
#initialize(target:, base:) ⇒ Quantity
: (target: Float, base: Float) -> void
183 184 185 186 |
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 183 def initialize(target:, base:) @target = target.to_f @base = base.to_f end |
Instance Method Details
#calc ⇒ Object
: () -> Float
194 195 196 197 198 199 200 |
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 194 def calc if @target > @base @target / @base else @base / @target end end |
#to_f ⇒ Object
: () -> Float
189 190 191 |
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 189 def to_f calc.to_f end |