Class: Observr::Script::EvalContext
- Inherits:
-
Object
- Object
- Observr::Script::EvalContext
- 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
-
#default_action(&action) ⇒ Object
Delegated to script.
-
#initialize(script) ⇒ EvalContext
constructor
:nodoc:.
-
#reload ⇒ Object
Reload script.
-
#watch(*args, &block) ⇒ Object
Delegated to script.
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 |
#reload ⇒ Object
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 |