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
Returns a new instance of Direction.
105 106 107 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 105 def initialize(angle:) @angle = angle end |
Instance Method Details
#calc ⇒ Object
113 114 115 116 117 118 119 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 113 def calc if @angle > 0 CLOCKWISE else COUNTERCLOCKWISE end end |
#to_s ⇒ Object
109 110 111 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 109 def to_s calc end |