Class: Rednode::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/rednode/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(main) ⇒ Node

Returns a new instance of Node.



7
8
9
10
11
# File 'lib/rednode/node.rb', line 7

def initialize(main)
  @engine = V8::Context.new
  @node = @engine.load(File.join(NODE_HOME, 'src', 'node.js'))
  @main = main
end

Instance Attribute Details

#engineObject (readonly)

Returns the value of attribute engine.



5
6
7
# File 'lib/rednode/node.rb', line 5

def engine
  @engine
end

#mainObject (readonly)

Returns the value of attribute main.



5
6
7
# File 'lib/rednode/node.rb', line 5

def main
  @main
end

Instance Method Details

#start(process = Process.new(self)) ⇒ Object



13
14
15
# File 'lib/rednode/node.rb', line 13

def start(process = Process.new(self))
  @node.call(process)
end