Sha256: c2140cb9aa29ed35d4fcdae2d193738dbbf255876b671803dc890608b754608c

Contents?: true

Size: 656 Bytes

Versions: 17

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

module GLib
  # Represents a null-terminated array of strings. GLib uses this construction,
  # but does not provide any actual functions for this class.
  #
  # The implementation is mainly inherited from GObjectIntrospection::Strv.
  class Strv < GObjectIntrospection::Strv
    def ==(other)
      to_a == other.to_a
    end

    def self.from(obj)
      case obj
      when nil
        nil
      when FFI::Pointer
        wrap obj
      when self
        obj
      else
        from_enumerable obj
      end
    end

    def self.from_enumerable(enum)
      wrap GirFFI::InPointer.from_array :utf8, enum
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
gir_ffi-0.17.0 lib/ffi-glib/strv.rb
gir_ffi-0.16.1 lib/ffi-glib/strv.rb
gir_ffi-0.16.0 lib/ffi-glib/strv.rb
gir_ffi-0.15.9 lib/ffi-glib/strv.rb
gir_ffi-0.15.8 lib/ffi-glib/strv.rb
gir_ffi-0.15.7 lib/ffi-glib/strv.rb
gir_ffi-0.15.6 lib/ffi-glib/strv.rb
gir_ffi-0.15.5 lib/ffi-glib/strv.rb
gir_ffi-0.15.4 lib/ffi-glib/strv.rb
gir_ffi-0.15.3 lib/ffi-glib/strv.rb
gir_ffi-0.15.2 lib/ffi-glib/strv.rb
gir_ffi-0.15.1 lib/ffi-glib/strv.rb
gir_ffi-0.15.0 lib/ffi-glib/strv.rb
gir_ffi-0.14.1 lib/ffi-glib/strv.rb
gir_ffi-0.14.0 lib/ffi-glib/strv.rb
gir_ffi-0.13.1 lib/ffi-glib/strv.rb
gir_ffi-0.13.0 lib/ffi-glib/strv.rb