class SardonyxRing::Handlers::ActionHandler
Attributes
action_id[R]
Public Class Methods
new(action_id, callback)
click to toggle source
# File lib/sardonyx_ring/handlers/action_handler.rb, line 6 def initialize(action_id, callback) @action_id = action_id @callback = callback end
Public Instance Methods
match?(action_event)
click to toggle source
# File lib/sardonyx_ring/handlers/action_handler.rb, line 18 def match?(action_event) @action_id == action_event.current_action.action_id end
run(app, action_event)
click to toggle source
# File lib/sardonyx_ring/handlers/action_handler.rb, line 13 def run(app, action_event) args = [action_event].slice(0, @callback.arity) @callback.bind(app).call(*args) end