Class: Observr::Script::EvalContext

Inherits:
Object
  • Object
show all
Defined in:
lib/observr/script.rb

Overview

Script file evaluation context

Script files are evaluated in the context of an instance of this class so that they get a clearly defined set of methods to work with. In other words, it is the user script’s API.

Instance Method Summary collapse

Constructor Details

#initialize(script) ⇒ EvalContext

:nodoc:



34
35
36
# File 'lib/observr/script.rb', line 34

def initialize(script)
  @__script = script
end

Instance Method Details

#default_action(&action) ⇒ Object

Delegated to script



39
40
41
# File 'lib/observr/script.rb', line 39

def default_action(&action)
  @__script.default_action(&action)
end

#reloadObject

Reload script



49
50
51
# File 'lib/observr/script.rb', line 49

def reload
  @__script.parse!
end

#watch(*args, &block) ⇒ Object

Delegated to script



44
45
46
# File 'lib/observr/script.rb', line 44

def watch(*args, &block)
  @__script.watch(*args, &block)
end