class GLib::Flags

Public Class Methods

_load(obj) click to toggle source
# File lib/glib2.rb, line 239
def _load(obj)
  new(Marshal.load(obj))
end
try_convert(value) click to toggle source
# File lib/glib2.rb, line 224
def try_convert(value)
  case value
  when self
    value
  when Integer, String, Symbol, Array
    begin
      new(value)
    rescue ArgumentError
      nil
    end
  else
    nil
  end
end

Public Instance Methods

_dump(limit) click to toggle source
# File lib/glib2.rb, line 244
def _dump(limit)
  Marshal.dump(to_i, limit)
end
inspect() click to toggle source

FIXME

# File lib/glib2.rb, line 249
def inspect
  values = self.class.values
  if values.find{|x| x == self }
    body = nick
  else
    a = values.select{|x| self >= x }
    a = a.reject{|x| a.find{|y| y > x } }
    body = a.empty? ? '{}' : a.map{|x| x.nick }.join('|')
  end
  format('#<%s %s>', self.class.inspect, body)
end