class GLib::VariantType

Public Class Methods

try_convert(value) click to toggle source
# File lib/glib2/variant-type.rb, line 20
def try_convert(value)
  case value
  when String
    new(value)
  when Symbol
    constant_name = value.to_s.upcase
    if const_defined?(constant_name)
      const_get(constant_name)
    else
      nil
    end
  else
    nil
  end
end

Public Instance Methods

inspect() click to toggle source
Calls superclass method
# File lib/glib2/variant-type.rb, line 37
def inspect
  super.gsub(/>\z/) do
    " string=#{self}>"
  end
end