Class: Qt::Rect

Inherits:
Object show all
Defined in:
lib/ruber/qt_sugar.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) _load(str)



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

+ (Object) yaml_new(cls, tag, val)



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

- (Object) _dump(_)



229
230
231
# File 'lib/ruber/qt_sugar.rb', line 229

def _dump _
  "#{left};#{top};#{width};#{height}"
end

- (Object) to_yaml(opts = {})



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