Module: Smelter::Scriptable::ClassMethods

Defined in:
lib/smelter/scriptable.rb

Instance Method Summary collapse

Instance Method Details

#define(id, &block) ⇒ Object



47
48
49
50
# File 'lib/smelter/scriptable.rb', line 47

def define(id, &block)
  definition_proxy = DefinitionProxy.new(id)
  definition_proxy.instance_eval(&block)
end

#runner(id = nil) ⇒ Object



41
42
43
44
45
# File 'lib/smelter/scriptable.rb', line 41

def runner(id=nil)
  return ScriptRunner.new unless id
  script = find(id)
  script.register
end

#runner_include(mod) ⇒ Object



37
38
39
# File 'lib/smelter/scriptable.rb', line 37

def runner_include(mod)
  Smelter::ScriptRunner.include(mod)
end