Class: GirFFI::Builder::Type::Base

Inherits:
Object
  • Object
show all
Includes:
GirFFI::BuilderHelper
Defined in:
lib/gir_ffi/builder/type/base.rb

Overview

Base class for type builders.

Direct Known Subclasses

Callback, Constant, RegisteredType

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GirFFI::BuilderHelper

#const_defined_for, #optionally_define_constant

Constructor Details

#initialize(info) ⇒ Base



11
12
13
14
15
# File 'lib/gir_ffi/builder/type/base.rb', line 11

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/builder/type/base.rb', line 24

def info
  @info
end

Instance Method Details

#build_classObject



17
18
19
20
21
22
# File 'lib/gir_ffi/builder/type/base.rb', line 17

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