Skip to content

Instantly share code, notes, and snippets.

@davidrichards
Created June 19, 2012 02:51
Show Gist options
  • Save davidrichards/2952037 to your computer and use it in GitHub Desktop.
Save davidrichards/2952037 to your computer and use it in GitHub Desktop.
Basic Includes and Extends
require 'forwardable'
class A
include Enumerable
extend Forwardable
def_delegators :@source, :[], :<<
def initialize
@source = []
end
def each(&block)
@source.each(&block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment