Sha256: fb1bd3cd4d93ab8929fb801d23fb636972a95748960a3b68ccf6ecf1fa950f89

Contents?: true

Size: 474 Bytes

Versions: 9

Compression:

Stored size: 474 Bytes

Contents

# frozen_string_literal: true
module GirFFI
  # Wrapper class providing extended functionality for a GType, which is
  # normally just a kind of integer
  class GType
    def initialize(gtype)
      @gtype = gtype
    end

    def to_i
      @gtype
    end

    def class_size
      type_query.class_size
    end

    def instance_size
      type_query.instance_size
    end

    private

    def type_query
      @type_query ||= GObject.type_query @gtype
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 lib/gir_ffi/g_type.rb
gir_ffi-0.11.0 lib/gir_ffi/g_type.rb
gir_ffi-0.10.2 lib/gir_ffi/g_type.rb
gir_ffi-0.10.1 lib/gir_ffi/g_type.rb
gir_ffi-0.10.0 lib/gir_ffi/g_type.rb
gir_ffi-0.10.0.pre1 lib/gir_ffi/g_type.rb
gir_ffi-0.9.5 lib/gir_ffi/g_type.rb
gir_ffi-0.9.4 lib/gir_ffi/g_type.rb
gir_ffi-0.9.3 lib/gir_ffi/g_type.rb