Class: Rednode::Node
- Inherits:
-
Object
- Object
- Rednode::Node
- Defined in:
- lib/rednode/node.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#main ⇒ Object
readonly
Returns the value of attribute main.
Instance Method Summary collapse
-
#initialize(main) ⇒ Node
constructor
A new instance of Node.
- #start(process = Process.new(self)) ⇒ Object
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
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
5 6 7 |
# File 'lib/rednode/node.rb', line 5 def engine @engine end |
#main ⇒ Object (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 |