Class: Norikra::Listener::Stdout

Inherits:
Base
  • Object
show all
Defined in:
lib/norikra/listener.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT_ASYNC_INTERVAL

Instance Attribute Summary collapse

Attributes inherited from Base

#events_statistics

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#background, #push, #shutdown, #start, #type_convert, #update

Constructor Details

#initialize(argument, query_name, query_group) ⇒ Stdout

Returns a new instance of Stdout.



238
239
240
241
# File 'lib/norikra/listener.rb', line 238

def initialize(argument, query_name, query_group)
  super
  @stdout = STDOUT
end

Instance Attribute Details

#stdoutObject

Returns the value of attribute stdout.



232
233
234
# File 'lib/norikra/listener.rb', line 232

def stdout
  @stdout
end

Class Method Details

.labelObject



234
235
236
# File 'lib/norikra/listener.rb', line 234

def self.label
  "STDOUT"
end

Instance Method Details

#process_sync(news, olds) ⇒ Object



243
244
245
246
247
# File 'lib/norikra/listener.rb', line 243

def process_sync(news, olds)
  news.each do |e|
    @stdout.puts @query_name + "\t" + JSON.dump(e)
  end
end