Sha256: 9567af52c4eb81dd9ed0240acd402ef8a934f5dba559d927e51048c9934005de

Contents?: true

Size: 475 Bytes

Versions: 22

Compression:

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

22 entries across 22 versions & 1 rubygems

Version Path
gir_ffi-0.17.0 lib/gir_ffi/g_type.rb
gir_ffi-0.16.1 lib/gir_ffi/g_type.rb
gir_ffi-0.16.0 lib/gir_ffi/g_type.rb
gir_ffi-0.15.9 lib/gir_ffi/g_type.rb
gir_ffi-0.15.8 lib/gir_ffi/g_type.rb
gir_ffi-0.15.7 lib/gir_ffi/g_type.rb
gir_ffi-0.15.6 lib/gir_ffi/g_type.rb
gir_ffi-0.15.5 lib/gir_ffi/g_type.rb
gir_ffi-0.15.4 lib/gir_ffi/g_type.rb
gir_ffi-0.15.3 lib/gir_ffi/g_type.rb
gir_ffi-0.15.2 lib/gir_ffi/g_type.rb
gir_ffi-0.15.1 lib/gir_ffi/g_type.rb
gir_ffi-0.15.0 lib/gir_ffi/g_type.rb
gir_ffi-0.14.1 lib/gir_ffi/g_type.rb
gir_ffi-0.14.0 lib/gir_ffi/g_type.rb
gir_ffi-0.13.1 lib/gir_ffi/g_type.rb
gir_ffi-0.13.0 lib/gir_ffi/g_type.rb
gir_ffi-0.12.1 lib/gir_ffi/g_type.rb
gir_ffi-0.12.0 lib/gir_ffi/g_type.rb
gir_ffi-0.11.4 lib/gir_ffi/g_type.rb