Sha256: aeaa3d1329d5a9fbd4a8923c7990f94629f65f22c04c76055775bcf156ce4e85

Contents?: true

Size: 949 Bytes

Versions: 7

Compression:

Stored size: 949 Bytes

Contents

require 'gir_ffi/builder/type/object'

module GirFFI
  module Builder
    module Type

      # Implements the creation of a class representing an object type for
      # which no data is found in the GIR. Typically, these are created to
      # cast objects returned by a function that returns an interface.
      class Unintrospectable < Object
        def instantiate_class
          gtype = target_gtype
          CACHE[gtype] ||= Class.new(superclass)
          @klass = CACHE[gtype]
          @structklass = get_or_define_class @klass, :Struct, layout_superclass
          setup_class unless already_set_up
        end

        def setup_class
          setup_constants
          setup_layout
          setup_interfaces
          setup_gtype_getter
        end

        def setup_instance_method method
          false
        end

        private

        def signal_definers
          info.interfaces
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gir_ffi-0.6.6 lib/gir_ffi/builder/type/unintrospectable.rb
gir_ffi-0.6.5 lib/gir_ffi/builder/type/unintrospectable.rb
gir_ffi-0.6.4 lib/gir_ffi/builder/type/unintrospectable.rb
gir_ffi-0.6.3 lib/gir_ffi/builder/type/unintrospectable.rb
gir_ffi-0.6.2 lib/gir_ffi/builder/type/unintrospectable.rb
gir_ffi-0.6.1 lib/gir_ffi/builder/type/unintrospectable.rb
gir_ffi-0.6.0 lib/gir_ffi/builder/type/unintrospectable.rb