Class: Norikra::Listener::Loopback
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#engine ⇒ Object
writeonly
Sets the attribute engine.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argument, query_name, query_group) ⇒ Loopback
constructor
A new instance of Loopback.
- #process_sync(news, olds) ⇒ Object
Methods inherited from Base
#apply_type_convert_to_events, #background, #push, #shutdown, #start, #type_convert, #update
Constructor Details
#initialize(argument, query_name, query_group) ⇒ Loopback
Returns a new instance of Loopback.
224 225 226 227 228 229 |
# File 'lib/norikra/listener.rb', line 224 def initialize(argument, query_name, query_group) super if @argument.nil? || @argument.empty? raise Norikra::ClientError, "LOOPBACK target name not specified" end end |
Instance Attribute Details
#engine=(value) ⇒ Object (writeonly)
Sets the attribute engine
205 206 207 |
# File 'lib/norikra/listener.rb', line 205 def engine=(value) @engine = value end |
Class Method Details
.label ⇒ Object
207 208 209 |
# File 'lib/norikra/listener.rb', line 207 def self.label "LOOPBACK" end |
Instance Method Details
#process_sync(news, olds) ⇒ Object
231 232 233 234 235 236 237 238 |
# File 'lib/norikra/listener.rb', line 231 def process_sync(news, olds) # We does NOT convert 'container.$0' into container['field']. # Use escaped names like 'container__0'. That is NOT so confused. trace("loopback event"){ { query: @query_name, group: @query_group, event: news } } if news.respond_to?(:each) @engine.send(@argument, news) end end |