Class: Observed::ProcTranslator
- Inherits:
-
Translator
- Object
- Translator
- Observed::ProcTranslator
- Defined in:
- lib/observed/config_builder.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ ProcTranslator
constructor
A new instance of ProcTranslator.
- #translate(tag, time, data) ⇒ Object
Methods inherited from Translator
Methods included from Pluggable
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 |