Skip to content

Instantly share code, notes, and snippets.

@actsasbuffoon
Created June 4, 2010 01:05
Show Gist options
  • Save actsasbuffoon/424764 to your computer and use it in GitHub Desktop.
Save actsasbuffoon/424764 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'metaid'
class Video
attr_reader :unreachable
def initialize
@unreachable = 'cant read this'
end
def another_method
'cant call this'
end
def custom_array
variable = 'cant touch this'
the_array = [1,2,3]
p = Proc.new do
[variable, @unreachable, another_method]
end
the_array.meta_def :mthd do
p.call
end
the_array
end
end
v = Video.new
puts v.custom_array.mthd.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment