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.



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

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

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



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

def info
  @info
end

Instance Method Details

#build_classObject



14
15
16
17
# File 'lib/gir_ffi/builders/base_type_builder.rb', line 14

def build_class
  instantiate_class unless defined? @klass
  @klass
end

#instantiate_classObject



19
20
21
# File 'lib/gir_ffi/builders/base_type_builder.rb', line 19

def instantiate_class
  setup_class unless already_set_up
end