Class: Operate::Pubsub::Events
- Inherits:
-
Object
- Object
- Operate::Pubsub::Events
- Defined in:
- lib/operate/pubsub/events.rb
Overview
Describes allowed events
Duck-types the argument to quack like array of strings when responding to the #include? method call.
Instance Method Summary collapse
-
#include?(event) ⇒ Boolean
Check if given event is included in the ‘list’ of events.
-
#initialize(list) ⇒ Events
constructor
Initialize with a list of events.
Constructor Details
#initialize(list) ⇒ Events
Initialize with a list of events.
11 12 13 |
# File 'lib/operate/pubsub/events.rb', line 11 def initialize(list) @list = list end |
Instance Method Details
#include?(event) ⇒ Boolean
Check if given event is included in the ‘list’ of events.
20 21 22 |
# File 'lib/operate/pubsub/events.rb', line 20 def include?(event) appropriate_method.call(event.to_s) end |