Module: GirFFI::Builders::TypeBuilder

Defined in:
lib/gir_ffi/builders/type_builder.rb

Overview

Builds a class based on information found in the introspection repository.

Constant Summary collapse

CACHE =
{}
TYPE_MAP =
{
  callback: CallbackBuilder,
  constant: ConstantBuilder,
  enum: EnumBuilder,
  flags: FlagsBuilder,
  interface: InterfaceBuilder,
  object: ObjectBuilder,
  struct: StructBuilder,
  union: UnionBuilder,
  unintrospectable_boxed: UnintrospectableBoxedBuilder,
  unintrospectable: UnintrospectableBuilder
}.freeze

Class Method Summary collapse

Class Method Details

.build(info) ⇒ Object



36
37
38
# File 'lib/gir_ffi/builders/type_builder.rb', line 36

def self.build(info)
  builder_for(info).build_class
end

.builder_for(info) ⇒ Object

TODO: Pull up to include :function and :module



41
42
43
# File 'lib/gir_ffi/builders/type_builder.rb', line 41

def self.builder_for(info)
  TYPE_MAP[info.info_type].new(info)
end