Class: Fusuma::Plugin::Detectors::RotateDetector::Direction

Inherits:
Object
  • Object
show all
Defined in:
lib/fusuma/plugin/detectors/rotate_detector.rb

Overview

direction of gesture

Constant Summary collapse

CLOCKWISE =
'clockwise'
COUNTERCLOCKWISE =
'counterclockwise'

Instance Method Summary collapse

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

#calcObject



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_sObject



109
110
111
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 109

def to_s
  calc
end