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
: () -> String.
-
#initialize(angle:) ⇒ Direction
constructor
: (angle: Float) -> void.
-
#to_s ⇒ Object
: () -> String.
Constructor Details
#initialize(angle:) ⇒ Direction
: (angle: Float) -> void
145 146 147 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 145 def initialize(angle:) @angle = angle.to_f end |
Instance Method Details
#calc ⇒ Object
: () -> String
155 156 157 158 159 160 161 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 155 def calc if @angle.positive? CLOCKWISE else COUNTERCLOCKWISE end end |
#to_s ⇒ Object
: () -> String
150 151 152 |
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 150 def to_s calc end |