Sha256: 364186183e52fb7813df722f76c7017b4203218dd6bac07147d0937a24f588f0

Contents?: true

Size: 644 Bytes

Versions: 6

Compression:

Stored size: 644 Bytes

Contents

module GObjectIntrospection
  # Wraps a GIFunctioInfo struct.
  # Represents a function.
  class IFunctionInfo < ICallableInfo
    def symbol
      Lib.g_function_info_get_symbol @gobj
    end
    def flags
      Lib.g_function_info_get_flags @gobj
    end

    #TODO: Use some sort of bitfield
    def method?
      flags & 1 != 0
    end
    def constructor?
      flags & 2 != 0
    end
    def getter?
      flags & 4 != 0
    end
    def setter?
      flags & 8 != 0
    end
    def wraps_vfunc?
      flags & 16 != 0
    end
    def throws?
      flags & 32 != 0
    end

    def safe_name
      name == '' ? '_' : name
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gir_ffi-0.4.0 lib/ffi-gobject_introspection/i_function_info.rb
gir_ffi-0.3.2 lib/ffi-gobject_introspection/i_function_info.rb
gir_ffi-0.3.1 lib/ffi-gobject_introspection/i_function_info.rb
gir_ffi-0.3.0 lib/ffi-gobject_introspection/i_function_info.rb
gir_ffi-0.2.3 lib/ffi-gobject_introspection/i_function_info.rb
gir_ffi-0.2.2 lib/ffi-gobject_introspection/i_function_info.rb