Skip to content

Instantly share code, notes, and snippets.

@aarongough
Created July 12, 2010 19:10
Show Gist options
  • Save aarongough/472918 to your computer and use it in GitHub Desktop.
Save aarongough/472918 to your computer and use it in GitHub Desktop.
basic_object = derive_from(blank_object)
basic_object[:slots][:lookup] = Proc.new do |this, message|
method_owner = this
while(!method_owner.nil? && method_owner[:slots][message.to_sym].nil?)
puts "ERR: lookup failed for '#{message}' on object:\n#{this.inspect}" and break if(method_owner[:parent].nil?)
method_owner = method_owner[:parent]
end
method_owner[:slots][message.to_sym] unless(method_owner.nil?)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment