class GObjectIntrospection::IConstantInfo

Wraps a GIConstantInfo struct; represents a constant.

Constants

TYPE_TAG_TO_UNION_MEMBER

Public Instance Methods

constant_type() click to toggle source
# File lib/ffi-gobject_introspection/i_constant_info.rb, line 33
def constant_type
  ITypeInfo.wrap(Lib.g_constant_info_get_type @gobj)
end
value() click to toggle source
# File lib/ffi-gobject_introspection/i_constant_info.rb, line 23
def value
  tag = constant_type.tag
  val = value_union[TYPE_TAG_TO_UNION_MEMBER[tag]]
  if RUBY_VERSION >= "1.9" and tag == :utf8
    val.force_encoding("utf-8")
  else
    val
  end
end
value_union() click to toggle source
# File lib/ffi-gobject_introspection/i_constant_info.rb, line 17
def value_union
  val = Lib::GIArgument.new
  Lib.g_constant_info_get_value @gobj, val
  return val
end