Class: GLib::Flags
- Inherits:
-
Object
- Object
- GLib::Flags
- Defined in:
- lib/glib2.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
._load(obj) ⇒ Object
188 189 190 |
# File 'lib/glib2.rb', line 188 def _load(obj) new(Marshal.load(obj)) end |
.try_convert(value) ⇒ Object
173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/glib2.rb', line 173 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 |
Instance Method Details
#_dump(limit) ⇒ Object
193 194 195 |
# File 'lib/glib2.rb', line 193 def _dump(limit) Marshal.dump(to_i, limit) end |
#inspect ⇒ Object
FIXME
198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/glib2.rb', line 198 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 |