Sha256: fc76e9affdd02702afa6533539f47ee2f6abe46d8fb1bb18ff3f6fd6e8370ab9

Contents?: true

Size: 758 Bytes

Versions: 4

Compression:

Stored size: 758 Bytes

Contents

# frozen_string_literal: true

require "gir_ffi/builders/registered_type_builder"
require "gir_ffi/interface_base"

module GirFFI
  module Builders
    # Implements the creation of a module representing an Interface.
    class InterfaceBuilder < RegisteredTypeBuilder
      def interface_struct
        @interface_struct ||= Builder.build_class iface_struct_info
      end

      private

      def klass
        @klass ||= get_or_define_module namespace_module, @classname
      end

      # FIXME: The word 'class' is not really correct.
      def setup_class
        klass.extend InterfaceBase
        setup_constants
        stub_methods
      end

      def iface_struct_info
        @iface_struct_info ||= info.iface_struct
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gir_ffi-0.15.3 lib/gir_ffi/builders/interface_builder.rb
gir_ffi-0.15.2 lib/gir_ffi/builders/interface_builder.rb
gir_ffi-0.15.1 lib/gir_ffi/builders/interface_builder.rb
gir_ffi-0.15.0 lib/gir_ffi/builders/interface_builder.rb