Class: Controll::Event::Matcher

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/controll/event/matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#create_event, #normalize

Constructor Details

#initialize(event) ⇒ Matcher

Returns a new instance of Matcher.



5
6
7
# File 'lib/controll/event/matcher.rb', line 5

def initialize event
  @event = normalize event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



3
4
5
# File 'lib/controll/event/matcher.rb', line 3

def event
  @event
end

Instance Method Details

#match?(events) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/controll/event/matcher.rb', line 9

def match? events
  normalized(events).include? event.name
end