Parent

RbVmomi::TypeLoader

Attributes

typenames[R]

Public Class Methods

new(target, fn) click to toggle source
# File lib/rbvmomi/type_loader.rb, line 21
def initialize target, fn
  @target = target
  @db = TypeStore.new fn
end

Public Instance Methods

has_type?(name) click to toggle source
# File lib/rbvmomi/type_loader.rb, line 38
def has_type? name
  fail unless name.is_a? String
  @typenames.member? name
end
init() click to toggle source
# 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
load_type(name) click to toggle source
# 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.