Class: Fusuma::Plugin::Detectors::PinchDetector::Direction
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Detectors::PinchDetector::Direction
- Defined in:
- lib/fusuma/plugin/detectors/pinch_detector.rb
Overview
direction of gesture
Constant Summary collapse
- IN =
"in"- OUT =
"out"
Instance Method Summary collapse
-
#calc ⇒ Object
: () -> String.
-
#initialize(target:, base:) ⇒ Direction
constructor
: (target: Float, base: Integer | Float) -> void.
-
#to_s ⇒ Object
: () -> String.
Constructor Details
#initialize(target:, base:) ⇒ Direction
: (target: Float, base: Integer | Float) -> void
160 161 162 163 |
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 160 def initialize(target:, base:) @target = target.to_f @base = base.to_f end |
Instance Method Details
#calc ⇒ Object
: () -> String
171 172 173 174 175 176 177 |
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 171 def calc if @target > @base OUT else IN end end |
#to_s ⇒ Object
: () -> String
166 167 168 |
# File 'lib/fusuma/plugin/detectors/pinch_detector.rb', line 166 def to_s calc end |