Skip to content

Instantly share code, notes, and snippets.

@pda
Created October 28, 2009 11:34
Show Gist options
  • Save pda/220432 to your computer and use it in GitHub Desktop.
Save pda/220432 to your computer and use it in GitHub Desktop.
class A
def with(&block)
instance_eval(&block)
end
private
def private_blarg
puts 'this is from a private method'
end
end
closured = 'this is inherited through closure'
A.new.with do
puts closured
private_blarg
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment