Class: GObjectIntrospection::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/gobject-introspection/loader.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_module) ⇒ Loader

Returns a new instance of Loader.



28
29
30
31
# File 'lib/gobject-introspection/loader.rb', line 28

def initialize(base_module)
  @base_module = base_module
  @version = nil
end

Instance Attribute Details

#versionObject

Returns the value of attribute version.



27
28
29
# File 'lib/gobject-introspection/loader.rb', line 27

def version
  @version
end

Class Method Details

.load(namespace, base_module, options = {}) ⇒ Object



20
21
22
23
24
# File 'lib/gobject-introspection/loader.rb', line 20

def load(namespace, base_module, options={})
  loader = new(base_module)
  loader.version = options[:version]
  loader.load(namespace)
end

Instance Method Details

#load(namespace) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/gobject-introspection/loader.rb', line 33

def load(namespace)
  repository = Repository.default
  repository.require(namespace, @version)
  pre_load(repository, namespace)
  repository.each(namespace) do |info|
    load_info(info)
  end
  post_load(repository, namespace)
end