Class: HasuraHandler::EventHandler
- Inherits:
-
Object
- Object
- HasuraHandler::EventHandler
- Defined in:
- lib/hasura_handler/event_handler.rb
Class Attribute Summary collapse
-
.hasura_matchers ⇒ Object
readonly
Returns the value of attribute hasura_matchers.
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event) ⇒ EventHandler
constructor
A new instance of EventHandler.
Constructor Details
#initialize(event) ⇒ EventHandler
Returns a new instance of EventHandler.
21 22 23 |
# File 'lib/hasura_handler/event_handler.rb', line 21 def initialize(event) @event = event end |
Class Attribute Details
.hasura_matchers ⇒ Object (readonly)
Returns the value of attribute hasura_matchers.
4 5 6 |
# File 'lib/hasura_handler/event_handler.rb', line 4 def hasura_matchers @hasura_matchers end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
19 20 21 |
# File 'lib/hasura_handler/event_handler.rb', line 19 def event @event end |
Class Method Details
.match_by(matchers) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/hasura_handler/event_handler.rb', line 6 def match_by(matchers) raise 'matcher must be a hash' unless matchers.is_a?(Hash) allowed_matchers = [:table, :trigger, :op] matchers.keys.each do |matcher| raise 'invalid matcher' unless allowed_matchers.include?(matcher) raise 'invalid matcher value' unless matchers[matcher].is_a?(String) end @hasura_matchers = matchers end |