@anonymous/

WarmFreshDesigner

Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
def with(i, &block)
  i.instance_exec(&block)
  return i
end

class Lol
  def foo
    puts "lol"
  end
end

class Lel
  def bar
    puts "lel"
  end
end

with(Lol.new) do
  foo
  with(Lel.new) do 
    bar
    #foo # throws
  end
end
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]