Class: LogStash::Filters::Ruby::Script::ExecutionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filters/ruby/script/execution_context.rb

Overview

A blank area for our script to live in. Everything is instance_eval,exec‘d against this to eliminate instance var and method def conflicts against other objects

Instance Method Summary collapse

Constructor Details

#initialize(name, logger) ⇒ ExecutionContext

Returns a new instance of ExecutionContext.



6
7
8
9
10
# File 'lib/logstash/filters/ruby/script/execution_context.rb', line 6

def initialize(name, logger)
  # Namespaced with underscore so as not to conflict with anything the user sets
  @__name__ = name
  @__logger__ = logger
end

Instance Method Details

#loggerObject



12
13
14
# File 'lib/logstash/filters/ruby/script/execution_context.rb', line 12

def logger
  @__logger__
end

#register(params) ⇒ Object



16
17
18
# File 'lib/logstash/filters/ruby/script/execution_context.rb', line 16

def register(params)
  logger.debug("skipping register since the script didn't define it")
end

#to_sObject



20
21
22
# File 'lib/logstash/filters/ruby/script/execution_context.rb', line 20

def to_s
  "<ExecutionContext #{@__name__}>"
end