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.



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

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

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



25
26
27
# File 'lib/gir_ffi/builders/base_type_builder.rb', line 25

def info
  @info
end

Instance Method Details

#build_classObject



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

def build_class
  instantiate_class unless defined? @klass
  @klass
end

#instantiate_classObject



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

def instantiate_class
  setup_class unless already_set_up
end