Skip to content

Instantly share code, notes, and snippets.

@liangzan
Created September 19, 2010 03:34
Show Gist options
  • Save liangzan/586340 to your computer and use it in GitHub Desktop.
Save liangzan/586340 to your computer and use it in GitHub Desktop.
# lib/culerity/remote_browser_object.rb
def send_remote(name, *args, &blk)
input = [remote_object_id, %Q{"#{name}"}, *args.map{|a| arg_to_string(a)}]
serialized_block = ", #{block_to_string(&blk)}" if block_given?
@io << "[[#{input.join(", ")}]#{serialized_block}]\n"
process_result @io.gets.to_s.strip
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment