lib/culerity/remote_object_proxy.rb in caius-culerity-0.1.5 vs lib/culerity/remote_object_proxy.rb in caius-culerity-0.1.6
- old
+ new
@@ -11,10 +11,20 @@
def initialize(remote_object_id, io)
@remote_object_id = remote_object_id
@io = io
end
+ # Commonly used to get the HTML id attribute
+ # Use `object_id` to get the local objects' id.
+ def id
+ send_remote(:id)
+ end
+
def method_missing(name, *args)
+ send_remote(name, *args)
+ end
+
+ def send_remote(name, *args)
@io << "[#{remote_object_id}, \"#{name}\", #{args.map{|a| a.inspect}.join(', ')}]\n"
process_result @io.gets.to_s.strip
end
def exit
\ No newline at end of file