Class: GLib::Enum

Inherits:
Object
  • Object
show all
Defined in:
glib2/lib/glib2.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

._load(obj) ⇒ Object



211
212
213
# File 'glib2/lib/glib2.rb', line 211

def _load(obj)
  new(Marshal.load(obj))
end

.try_convert(value) ⇒ Object



203
204
205
206
207
208
209
# File 'glib2/lib/glib2.rb', line 203

def try_convert(value)
  if value.is_a?(self)
    value
  else
    find(value)
  end
end

Instance Method Details

#_dump(limit) ⇒ Object



216
217
218
# File 'glib2/lib/glib2.rb', line 216

def _dump(limit)
  Marshal.dump(to_i, limit)
end