# File lib/rbvmomi/type_loader.rb, line 21 def initialize target, fn @target = target @db = TypeStore.new fn end
# File lib/rbvmomi/type_loader.rb, line 38 def has_type? name fail unless name.is_a? String @typenames.member? name end
# File lib/rbvmomi/type_loader.rb, line 26 def init @typenames = Set.new(@db['_typenames'] + BasicTypes::BUILTIN) @target.constants.select { |x| has_type? x.to_s }.each { |x| load_type x.to_s } BasicTypes::BUILTIN.each do |x| @target.const_set x, BasicTypes.const_get(x) load_extension x end Object.constants.map(&:to_s).select { |x| has_type? x }.each do |x| load_type x end end
# File lib/rbvmomi/type_loader.rb, line 43 def load_type name fail unless name.is_a? String @target.const_set name, make_type(name) load_extension name nil end