class Controll::Event::Matcher

Attributes

event[R]

Public Class Methods

new(event) click to toggle source
# File lib/controll/event/matcher.rb, line 5
def initialize event
  @event = normalize event
end

Public Instance Methods

match?(events) click to toggle source
# File lib/controll/event/matcher.rb, line 9
def match? events
  normalized(events).include? event.name
end

Protected Instance Methods

normalized(events) click to toggle source
# File lib/controll/event/matcher.rb, line 17
def normalized events
  [events].flatten.map(&:to_sym)
end