Class: Rufus::Lua::Coroutine
- Rufus::Lua::Ref
- Rufus::Lua::Coroutine
(coming soon)
Constructor Summary
This class inherits a constructor from Rufus::Lua::Ref.
Public Visibility
Public Instance Method Summary
| #resume(*args) |
Resumes the coroutine. |
|---|---|
| #status |
Returns the string status of the coroutine : suspended/running/dead/normal. |
Public Instance Methods Inherited from Rufus::Lua::Ref
Public Instance Method Details
resume
public
resume(*args)
Resumes the coroutine
[View source]
112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/rufus/lua/objects.rb', line 112 def resume (*args) bottom = stack_top fetch_library_method('coroutine.resume').load_onto_stack load_onto_stack args.each { |arg| stack_push(arg) } pcall(bottom, args.length + 1) end |
status
public
status
Returns the string status of the coroutine : suspended/running/dead/normal
[View source]
127 128 129 130 131 132 133 134 135 |
# File 'lib/rufus/lua/objects.rb', line 127 def status bottom = stack_top fetch_library_method('coroutine.status').load_onto_stack load_onto_stack pcall(bottom, 1) end |