Class: GObjectIntrospection::RegisteredTypeInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/gobject-introspection/registered-type-info.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



38
39
40
# File 'lib/gobject-introspection/registered-type-info.rb', line 38

def description
  "#{gtype.to_class}(#{gtype.name})"
end

#try_convert(value) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/gobject-introspection/registered-type-info.rb', line 19

def try_convert(value)
  return nil if value.nil?

  type = gtype
  return value if type == GLib::Type::NONE

  klass = type.to_class
  case value
  when klass
    value
  else
    if klass.respond_to?(:try_convert)
      klass.try_convert(value)
    else
      nil
    end
  end
end