fork download
  1. def div(a="<a/>",b="<b/>",c="<c/>", &blk)
  2. env_kls = Struct.new(:a, :b, :c)
  3. env = env_kls.new(a, b, c)
  4. env.instance_exec(&blk)
  5. puts env.a
  6. end
  7.  
  8. div() { self.a = "foo" }
Success #stdin #stdout 0.02s 7452KB
stdin
Standard input is empty
stdout
foo