在标题中很难描述这一点。
I m 想通过一个可变体:不是一种实例,不是收集构成物体的财产,而是实际变量:handle至物体。
The reason for this is that I am dealing with resources that can be located on the filesystem, on the network, or in-memory. I want to create URI handler that can handle each of these in a consistent manner, so I can have schemes like eg.
- file://
- http://
- ftp://
- inmemory://
你们有这个想法。 这是我试图指出的最后一个例子:是否在某种程度上可以表明在Ruby提到物体的情况,然后利用这种说法来制定新的参考? 我确实有兴趣对
The only alternatives I can think of are:
- marshal the whole object and cram it into the URI, but that won t work because the data in the object is an image buffer - very large
- Create a global or singleton purgatory area to store a variable for retrieval later using e.g. a hash of object_id:variable pairs. This is a bit smelly, but would work.
任何其他想法,StackOverflowers?