在 Ruby 中,如果我将对象实例的 ID 作为字符串,例如
"#<Meeting:0x4531860>"
,我可以通过此 ID 获取实例的自身吗?
# what I want
meeting = SOME_MAGIC_HERE "#<Meeting:0x4531860>"
# and then I can handle the meeting itself
meeting.name # => 'BLABLABLA'
在 Ruby 中,如果我将对象实例的 ID 作为字符串,例如
"#<Meeting:0x4531860>"
,我可以通过此 ID 获取实例的自身吗?
# what I want
meeting = SOME_MAGIC_HERE "#<Meeting:0x4531860>"
# and then I can handle the meeting itself
meeting.name # => 'BLABLABLA'