Class: GirFFI::BaseTypeBuilder

Inherits:
Object
  • Object
show all
Includes:
BuilderHelper
Defined in:
lib/gir_ffi/builders/base_type_builder.rb

Overview

Base class for type builders.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BuilderHelper

#get_or_define_class, #get_or_define_module, #optionally_define_constant

Constructor Details

#initialize(info) ⇒ BaseTypeBuilder

Returns a new instance of BaseTypeBuilder.



9
10
11
12
13
# File 'lib/gir_ffi/builders/base_type_builder.rb', line 9

def initialize info
  @info = info
  @namespace = @info.namespace
  @classname = @info.safe_name
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



22
23
24
# File 'lib/gir_ffi/builders/base_type_builder.rb', line 22

def info
  @info
end

Instance Method Details

#build_classObject



15
16
17
18
19
20
# File 'lib/gir_ffi/builders/base_type_builder.rb', line 15

def build_class
  unless defined? @klass
    instantiate_class
  end
  @klass
end