mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
14 lines
150 B
Ruby
14 lines
150 B
Ruby
class ClassWithElementRef
|
|
def [](x)
|
|
yield x + 1
|
|
end
|
|
end
|
|
|
|
c = ClassWithElementRef.new
|
|
|
|
c[1] { |x| puts x }
|
|
|
|
c[1] do |x|
|
|
puts x
|
|
end
|