lib/mida_vocabulary/vocabularies/schemaorg.rb in mida_vocabulary-0.2 vs lib/mida_vocabulary/vocabularies/schemaorg.rb in mida_vocabulary-0.2.2

- old
+ new

@@ -1,17 +1,34 @@ -Dir.glob(File.dirname(__FILE__) + '/schemaorg/*.rb') {|file| require file} +module Mida + module SchemaOrg + def self.const_missing(name) + filename = File.dirname(__FILE__) + "/schemaorg/#{name.to_s.downcase}.rb" + + require filename + load filename unless self.const_defined?(name, false) + + self.const_get(name, false) if self.const_defined?(name, false) + end + + def self.forget_all! + constants.each do |name| + remove_const(name) + end + end + end +end