lib/double.rb in double-0.1.0 vs lib/double.rb in double-0.1.1
- old
+ new
@@ -15,19 +15,16 @@
def initialize(name)
@name = name
end
- def _
- @_ ||= ::Kernel.const_get @name
- end
-
def method_missing(mth, *args, &blk)
- if _.respond_to? mth
+ @klass ||= ::Kernel.eval "::#{@name}"
+ if @klass.respond_to? mth
(class << self; self; end).instance_eval do
- def_delegator :@_, mth
+ def_delegator :@klass, mth
end
- @_.send mth, *args, &blk
+ @klass.send mth, *args, &blk
else
super
end
end
end