class Rooibos::Router::MousemapBuilder
Builder for mousemap DSL.
Attributes
Returns the registered click handler.
Returns the registered scroll handlers (scroll_up, scroll_down).
Public Instance Methods
Source
# File lib/rooibos/router.rb, line 506 def click(handler_or_action) if handler_or_action.is_a?(Symbol) @click_handler = ClickHandlerConfig.new(action: handler_or_action) else @click_handler = ClickHandlerConfig.new(handler: handler_or_action) end end
Registers a click handler.
- handler_or_action
-
Callable ‘^(Integer, Integer) -> Command` or Symbol (action name).
Source
# File lib/rooibos/router.rb, line 518 def scroll(direction, handler_or_action) config = if handler_or_action.is_a?(Symbol) ScrollHandlerConfig.new(action: handler_or_action) else ScrollHandlerConfig.new(handler: handler_or_action) end @scroll_handlers[:"scroll_#{direction}"] = config end
Registers a scroll handler.
- direction
-
:upor:down. - handler_or_action
-
Callable ‘^() -> Command` or Symbol (action name).