Class: Fusuma::Plugin::Detectors::PinchDetector::Quantity

Inherits:
Object
  • Object
show all
Defined in:
lib/fusuma/plugin/detectors/pinch_detector.rb

Overview

quantity of gesture

Instance Method Summary collapse

Constructor Details

#initialize(diameter:) ⇒ Quantity

Returns a new instance of Quantity.



126
127
128
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 126

def initialize(diameter:)
  @diameter = diameter
end

Instance Method Details

#calcObject



134
135
136
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 134

def calc
  (1.0 - @diameter).abs
end

#to_fObject



130
131
132
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 130

def to_f
  calc.to_f
end