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.
138 139 140 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 138 def initialize(angle:) @angle = angle.to_f end |
Instance Method Details
#calc ⇒ Object
146 147 148 149 150 151 152 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 146 def calc if @angle.positive? CLOCKWISE else COUNTERCLOCKWISE end end |
#to_s ⇒ Object
142 143 144 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 142 def to_s calc end |