处置ruby类对象

时间:2010-07-14 14:02:29

标签: ruby

  • 如何在ruby中处理对象......?

class Designer
    def message
      "Hello, World!"
    end
end

c = Designer.new

c.dispose # this is not working... any idea... or any alternative...?


...日Thnx

1 个答案:

答案 0 :(得分:3)

class Designer
    def message
      "Hello, World!"
    end
end

c = Designer.new

# something like dispose :)
c = nil

# and you can add something like this
GC.start