开发者

dispose ruby class object

开发者 https://www.devze.com 2023-01-07 07:43 出处:网络
how to dispose an object in ruby...? class Designer def message \"He开发者_StackOverflowllo, World!\"
  • how to dispose an object in ruby...?

class Designer
    def message
      "He开发者_StackOverflowllo, World!"
    end
end

c = Designer.new

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


thnx...


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号