Sha256: 3ca2279522a0f11a14014cac9748335ecbd5a5dc8b71506a673f6f2f07bcfe1e

Contents?: true

Size: 807 Bytes

Versions: 11

Compression:

Stored size: 807 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

        def pretty_print
          "class #{@classname}\nend"
        end

        private

        def setup_class
          setup_layout
          setup_constants
          stub_methods
          setup_gtype_getter
          setup_field_accessors
          provide_constructor
        end

        def layout_superclass
          FFI::Union
        end
      end
    end
  end
end


Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gir_ffi-0.4.3 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.4.2 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.4.1 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.4.0 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.3.2 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.3.1 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.3.0 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.2.3 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.2.2 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.2.1 lib/gir_ffi/builder/type/union.rb
gir_ffi-0.2.0 lib/gir_ffi/builder/type/union.rb