# File lib/facet/module/include_as.rb, line 6 def include_as( h ) h.each{ |name, mod| s = self c = Class.new(SimpleDelegator) { include mod define_method(:initialize) { |s| super(s) } } class_eval { define_method( name ) { instance_variable_set( "@#{name}", instance_variable_get( "@#{name}" ) || c.new(s) ) } } } end