Class: Controll::Event::Matcher
- Inherits:
-
Object
- Object
- Controll::Event::Matcher
- Includes:
- Helper
- Defined in:
- lib/controll/event/matcher.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
-
#initialize(event) ⇒ Matcher
constructor
A new instance of Matcher.
- #match?(events) ⇒ Boolean
Methods included from Helper
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
#event ⇒ Object (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
9 10 11 |
# File 'lib/controll/event/matcher.rb', line 9 def match? events normalized(events).include? event.name end |