Sha256: 02f048c72453943c74a7b1b7eec0c0b95715a190572d388dfbc2abd2e2a2c445

Contents?: true

Size: 314 Bytes

Versions: 11

Compression:

Stored size: 314 Bytes

Contents

class Baza
  #Autoloader for subclasses.
  def self.const_missing(name)
    file_name = name.to_s.gsub(/(.)([A-Z])/,'\1_\2').downcase
    require "#{File.dirname(__FILE__)}/../include/#{file_name}.rb"
    raise "Still not defined: '#{name}'." if !Baza.const_defined?(name)
    return Baza.const_get(name)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
baza-0.0.13 lib/baza.rb
baza-0.0.12 lib/baza.rb
baza-0.0.11 lib/baza.rb
baza-0.0.10 lib/baza.rb
baza-0.0.9 lib/baza.rb
baza-0.0.8 lib/baza.rb
baza-0.0.7 lib/baza.rb
baza-0.0.6 lib/baza.rb
baza-0.0.5 lib/baza.rb
baza-0.0.4 lib/baza.rb
baza-0.0.3 lib/baza.rb