Class: Qt::Point
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
permalink ._load(str) ⇒ Object
[View source]
101 102 103 104 |
# File 'lib/ruber/qt_sugar.rb', line 101 def self._load str x, y = str.split ';' self.new x.to_i, y.to_i end |
permalink .yaml_new(cls, tag, val) ⇒ Object
[View source]
83 84 85 86 |
# File 'lib/ruber/qt_sugar.rb', line 83 def self.yaml_new cls, tag, val x, y= val['x'], val['y'] Qt::Point.new(x, y) end |
Instance Method Details
permalink #_dump(_) ⇒ Object
[View source]
97 98 99 |
# File 'lib/ruber/qt_sugar.rb', line 97 def _dump _ "#{x};#{self.y}" end |
permalink #to_yaml(opts = {}) ⇒ Object
[View source]
88 89 90 91 92 93 94 95 |
# File 'lib/ruber/qt_sugar.rb', line 88 def to_yaml opts = {} YAML.quick_emit(self, opts) do |out| out.map(taguri, to_yaml_style) do |map| map.add 'x', self.x map.add 'y', self.y end end end |