Module: AutoloadPatch

Included in:
NMatrix::IO, NMatrix::IO::Matlab
Defined in:
lib/nmatrix/monkeys.rb

Overview

Since ‘autoload` will most likely be deprecated (due to multi-threading concerns), we’ll use ‘const_missing`. See: www.ruby-forum.com/topic/3036681 for more info.

Instance Method Summary collapse

Instance Method Details

#const_missing(name) ⇒ Object

:nodoc



131
132
133
134
135
136
# File 'lib/nmatrix/monkeys.rb', line 131

def const_missing(name)
  file = name.to_s.underscore
  require "nmatrix/io/#{file}"
  klass = const_get(name)
  return klass if klass
end