class Foo
  def self.bar
    baz do 
      puts caller(1)
    end
  end
  
  def self.baz(&block)
     block.call
  end
end

Foo.bar
