# File lib/culerity/remote_object_proxy.rb, line 43 def exit @io << '["_exit_"]' end
Commonly used to get the HTML id attribute Use `object_id` to get the local objects’ id.
# File lib/culerity/remote_object_proxy.rb, line 20 def id send_remote(:id) end
# File lib/culerity/remote_object_proxy.rb, line 24 def method_missing(name, *args, &block) send_remote(name, *args, &block) end
Calls the passed method on the remote object with any arguments specified. Behaves the same as Object#send.
If you pass it a block then it will append the block as a “lambda { … }”. If your block returns a lambda string (“lambda { … }”) then it will be passed straight through, otherwise it will be wrapped in a lambda string before sending.
# File lib/culerity/remote_object_proxy.rb, line 36 def send_remote(name, *args, &blk) input = [remote_object_id, %{"#{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
Generated with the Darkfish Rdoc Generator 2.