Class: Fusuma::Plugin::Detectors::RotateDetector::Direction
- Inherits:
-
Object
- Object
- Fusuma::Plugin::Detectors::RotateDetector::Direction
- Defined in:
- lib/fusuma/plugin/detectors/rotate_detector.rb
Overview
direction of gesture
Constant Summary collapse
- CLOCKWISE =
'clockwise'- COUNTERCLOCKWISE =
'counterclockwise'
Instance Method Summary collapse
- #calc ⇒ Object
-
#initialize(angle:) ⇒ Direction
constructor
A new instance of Direction.
- #to_s ⇒ Object
Constructor Details
#initialize(angle:) ⇒ Direction
102 103 104 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 102 def initialize(angle:) @angle = angle end |
Instance Method Details
#calc ⇒ Object
110 111 112 113 114 115 116 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 110 def calc if @angle > 0 CLOCKWISE else COUNTERCLOCKWISE end end |
#to_s ⇒ Object
106 107 108 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 106 def to_s calc end |