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.



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

def info
  @info
end

Instance Method Details

#build_classObject



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

def build_class
  instantiate_class unless defined? @klass
  @klass
end

#instantiate_classObject



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

def instantiate_class
  setup_class unless already_set_up
end