Class: Class
Instance Method Summary collapse
Instance Method Details
#autoload_method(method, library) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/carray/autoload.rb', line 27 def autoload_method (method, library) class_eval %{ def #{method} (*argv, &block) begin require "#{library}" rescue LoadError raise "error in autoloading '#{library}' hooked by method '#{method}', check gem installation." end #{method}(*argv, &block) end } end |