Module: Motion::Component::Motions::ModuleFunctions

Included in:
Motion::Component::Motions
Defined in:
lib/motion/component/motions.rb

Overview

Analogous to ‘module_function` (available on both class and instance)

Instance Method Summary collapse

Instance Method Details

#map_motion(motion, handler = motion) ⇒ Object



18
19
20
21
# File 'lib/motion/component/motions.rb', line 18

def map_motion(motion, handler = motion)
  self._motion_handlers =
    _motion_handlers.merge(motion.to_s => handler.to_sym).freeze
end

#motionsObject



28
29
30
# File 'lib/motion/component/motions.rb', line 28

def motions
  _motion_handlers.keys
end

#unmap_motion(motion) ⇒ Object



23
24
25
26
# File 'lib/motion/component/motions.rb', line 23

def unmap_motion(motion)
  self._motion_handlers =
    _motion_handlers.except(motion.to_s).freeze
end