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



102
103
104
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 102

def initialize(angle:)
  @angle = angle
end

Instance Method Details

#calcObject



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_sObject



106
107
108
# File 'lib/fusuma/plugin/detectors/rotate_detector.rb', line 106

def to_s
  calc
end