Created
June 4, 2010 01:05
-
-
Save actsasbuffoon/424764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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