Sha256: 85226e54dc7f1f924e87270a5bc404915a3a30ddc7997c3cb4e92e5c2ff2379d

Contents?: true

Size: 482 Bytes

Versions: 2

Compression:

Stored size: 482 Bytes

Contents

# frozen_string_literal: true
require 'gir_ffi/struct_like_base'

module GirFFI
  # Base class for generated classes representing GLib structs.
  class StructBase < ClassBase
    extend FFI::DataConverter
    extend GirFFI::StructLikeBase

    def initialize
      @struct = self.class::Struct.new
      @struct.owned = true
      @struct.to_ptr.autorelease = false
    end

    # Wrap value and take ownership of it
    def self.wrap_own(val)
      own wrap(val)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gir_ffi-0.10.2 lib/gir_ffi/struct_base.rb
gir_ffi-0.10.1 lib/gir_ffi/struct_base.rb