class Rufus::Lua::Coroutine

(coming soon)

Public Instance Methods

resume(*args) click to toggle source

Resumes the coroutine

# File lib/rufus/lua/objects.rb, line 88
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, nil, nil, nil)
end
status() click to toggle source

Returns the string status of the coroutine : suspended/running/dead/normal

# File lib/rufus/lua/objects.rb, line 103
def status

  bottom = stack_top

  fetch_library_method('coroutine.status').load_onto_stack
  load_onto_stack

  pcall(bottom, 1, nil, nil, nil)
end