Class: Qt::Date

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)



331
332
333
334
# File 'lib/ruber/qt_sugar.rb', line 331

def self._load str
  y, m, d = str.split ';'
  self.new(y.to_i, m.to_i, d.to_i)
end

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



312
313
314
315
# File 'lib/ruber/qt_sugar.rb', line 312

def self.yaml_new cls, tag, val
  y, m, d = val['year'], val['month'], val['day']
  Qt::Date.new(y, m, d)
end

Instance Method Details

- (Object) _dump(_)



327
328
329
# File 'lib/ruber/qt_sugar.rb', line 327

def _dump _
  "#{year};#{month};#{day}"
end

- (Object) to_yaml(opts = {})



317
318
319
320
321
322
323
324
325
# File 'lib/ruber/qt_sugar.rb', line 317

def to_yaml opts = {}
  YAML.quick_emit(self, opts) do |out|
    out.map(taguri, to_yaml_style) do |map|
      map.add 'year', year
      map.add 'month', month
      map.add 'day', day
    end
  end
end