Skip to content

Instantly share code, notes, and snippets.

@erikh
Created July 23, 2013 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikh/4a7f49685d103a18d45c to your computer and use it in GitHub Desktop.
Save erikh/4a7f49685d103a18d45c to your computer and use it in GitHub Desktop.
class FancyArray < DelegateClass(Array)
def initialize(args)
@args = args
super([])
end
def [](idx)
puts "I'm a fancy waste of processing power"
@args[idx]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment