Class: Ichabod::ScriptObject::Ichabod

Inherits:
Object
  • Object
show all
Defined in:
lib/ichabod/script_object/ichabod.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runtime) ⇒ Ichabod

Returns a new instance of Ichabod.



6
7
8
# File 'lib/ichabod/script_object/ichabod.rb', line 6

def initialize(runtime)
  @runtime = runtime
end

Instance Attribute Details

#runtimeObject (readonly)

Returns the value of attribute runtime.



4
5
6
# File 'lib/ichabod/script_object/ichabod.rb', line 4

def runtime
  @runtime
end

Instance Method Details

#argsObject



26
27
28
# File 'lib/ichabod/script_object/ichabod.rb', line 26

def args
  ARGV
end

#eval(js) ⇒ Object



14
15
16
# File 'lib/ichabod/script_object/ichabod.rb', line 14

def eval(js)
  runtime.eval(js)
end

#exit(code = 0) ⇒ Object



18
19
20
# File 'lib/ichabod/script_object/ichabod.rb', line 18

def exit(code = 0)
  Kernel.exit(code)
end

#invokeUndefinedMethodFromWebScript(name, withArguments: args) ⇒ Object



30
31
32
# File 'lib/ichabod/script_object/ichabod.rb', line 30

def invokeUndefinedMethodFromWebScript(name, withArguments:args)
  send(name, *args)
end

#open(url) ⇒ Object



10
11
12
# File 'lib/ichabod/script_object/ichabod.rb', line 10

def open(url)
  runtime.open(url)
end

#sleep(secs = 0) ⇒ Object



22
23
24
# File 'lib/ichabod/script_object/ichabod.rb', line 22

def sleep(secs = 0)
  Kernel.sleep(secs)
end