[ create a new paste ] login | about

Link: http://codepad.org/bifkv52L    [ raw code | output | fork ]

Ruby, pasted on Feb 29:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
puts RUBY_VERSION

class A
  def <<(n)
  end
end

class B
  def <<(n)
    return "not self"
  end
end

a = A.new
p a << "dummy"

b = B.new
p b << "dummy"


Output:
1
2
3
1.8.6
nil
"not self"


Create a new paste based on this one


Comments: