Class: Qt::Rect
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
permalink ._load(str) ⇒ Object
[View source]
233 234 235 236 |
# File 'lib/ruber/qt_sugar.rb', line 233 def self._load str l, t, w, h = str.split ';' self.new l.to_i, t.to_i, w.to_i, h.to_i end |
permalink .yaml_new(cls, tag, val) ⇒ Object
[View source]
212 213 214 215 216 |
# File 'lib/ruber/qt_sugar.rb', line 212 def self.yaml_new cls, tag, val left, top, width, height= val['left'], val['top'], val['width'], val['height'] self.new(left, top, width, height) end |
Instance Method Details
permalink #_dump(_) ⇒ Object
[View source]
229 230 231 |
# File 'lib/ruber/qt_sugar.rb', line 229 def _dump _ "#{left};#{top};#{width};#{height}" end |
permalink #to_yaml(opts = {}) ⇒ Object
[View source]
218 219 220 221 222 223 224 225 226 227 |
# File 'lib/ruber/qt_sugar.rb', line 218 def to_yaml opts = {} YAML.quick_emit(self, opts) do |out| out.map(taguri, to_yaml_style) do |map| map.add 'left', left map.add 'top', top map.add 'width', width map.add 'height', height end end end |