Sha256: ea76afcc1757fb6221f5f88137cc8b4b48c32eecefa1ac25a3669f1fefc55c5f

Contents?: true

Size: 791 Bytes

Versions: 5

Compression:

Stored size: 791 Bytes

Contents

require 'gir_ffi/builder/type/registered_type'
require 'gir_ffi/builder/type/with_layout'
require 'gir_ffi/builder/type/with_methods'

module GirFFI
  module Builder
    module Type

      # Implements the creation of a class representing union type. The
      # class will have a nested FFI::Union class to represent its C union.
      class Union < RegisteredType
        include WithMethods
        include WithLayout

        private

        def instantiate_class
          @klass = get_or_define_class namespace_module, @classname, superclass
          @structklass = get_or_define_class @klass, :Struct, FFI::Union
          setup_class unless already_set_up
        end

        def setup_class
          super
          provide_constructor
        end
      end
    end
  end
end


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gir_ffi-0.1.0 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.0.14 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.0.13 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.0.12 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.0.11 lib/gir_ffi/builder/type/union.rb