Skip to content

Instantly share code, notes, and snippets.

@selman
Created February 25, 2012 00:09
Show Gist options
  • Save selman/1904776 to your computer and use it in GitHub Desktop.
Save selman/1904776 to your computer and use it in GitHub Desktop.
require "forwardable"
class TheClass
extend Forwardable
attr_reader :items
def_delegators :@items, :<<, :push
def initialize; @items = [] end
end
x = TheClass.new
x << 'blue'
x.push 'orange'
x.items
@shime
Copy link

shime commented Apr 8, 2012

thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment