Class: Qt::DateTime

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)



360
361
362
363
# File 'lib/ruber/qt_sugar.rb', line 360

def self._load str
  date, time, time_spec = Marshal.load str
  self.new date, time, time_spec
end

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



341
342
343
344
# File 'lib/ruber/qt_sugar.rb', line 341

def self.yaml_new cls, tag, val
  date, time, spec = val['date'], val['time'], val['time_spec']
  Qt::DateTime.new date, time, spec
end

Instance Method Details

- (Object) _dump(_)



356
357
358
# File 'lib/ruber/qt_sugar.rb', line 356

def _dump _
  Marshal.dump [date, time, time_spec]
end

- (Object) to_yaml(opts = {})



346
347
348
349
350
351
352
353
354
# File 'lib/ruber/qt_sugar.rb', line 346

def to_yaml opts = {}
  YAML.quick_emit(self, opts) do |out|
    out.map(taguri, to_yaml_style) do |map|
      map.add 'date', date
      map.add 'time', time
      map.add 'time_spec', time_spec
    end
  end
end