Monday, 31 October 2016

yo.rb

def (t = Object.new).yolo(other)
puts other
end
t.yolo(2)
# 2.1.6 :023 > t.yolo(2)
# 2
t = String.new("yolo")
def t.to_s
puts "other " + super
end
t.to_s
# other yolo
# => nil
view raw yo.rb hosted with ❤ by GitHub

No comments:

Post a Comment