Class: Observed::ProcTranslator

Inherits:
Translator show all
Defined in:
lib/observed/config_builder.rb

Instance Method Summary collapse

Methods inherited from Translator

#match

Methods included from Pluggable

included

Methods included from Logging

#log_debug, #log_error, #log_info, #log_warn, #logging_enabled?

Methods included from Configurable

#configure, #get_attribute_value, #has_attribute_value?, included

Constructor Details

#initialize(&block) ⇒ ProcTranslator

Returns a new instance of ProcTranslator.



23
24
25
# File 'lib/observed/config_builder.rb', line 23

def initialize(&block)
  @block = block
end

Instance Method Details

#translate(tag, time, data) ⇒ Object



26
27
28
# File 'lib/observed/config_builder.rb', line 26

def translate(tag, time, data)
  @block.call data, {tag: tag, time: time}
end