Skip to content

Instantly share code, notes, and snippets.

@aarongough
Created July 12, 2010 19:03
Show Gist options
  • Save aarongough/472906 to your computer and use it in GitHub Desktop.
Save aarongough/472906 to your computer and use it in GitHub Desktop.
def send(receiver, message, *params, &block)
method_owner = receiver
while(method_owner[:slots][:lookup].nil?)
puts "ERR: lookup failed for ':lookup' on object:\n#{receiver.inspect}" and break if(method_owner[:parent].nil?)
method_owner = method_owner[:parent]
end
method = method_owner[:slots][:lookup].call(receiver, message)
exit if(method.nil?)
method.call(receiver, params << block)
end
def derive_from(object)
child = {}
child[:parent] = object
child[:size] = 0
child[:slots] = {}
return child
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment