Class: Qt::Date

Inherits:
Base show all
Defined in:
lib/Qt/qtruby4.rb

Instance Method Summary collapse

Methods inherited from Base

#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #QCOMPARE, #QEXPECT_FAIL, #QFAIL, #QSKIP, #QTEST, #QVERIFY, #QVERIFY2, #QWARN, #^, ancestors, #is_a?, #methods, private_slots, #protected_methods, #public_methods, q_classinfo, q_signal, q_slot, signals, #singleton_methods, slots, #|, #~

Constructor Details

#initialize(*args) ⇒ Date

Returns a new instance of Date



651
652
653
654
655
656
657
# File 'lib/Qt/qtruby4.rb', line 651

def initialize(*args)
  if args.size == 1 && args[0].class.name == "Date"
    return super(args[0].year, args[0].month, args[0].day)
  else
    return super(*args)
  end
end

Instance Method Details

#inspectObject



659
660
661
662
# File 'lib/Qt/qtruby4.rb', line 659

def inspect
  str = super
  str.sub(/>$/, " %s>" % toString)
end

#pretty_print(pp) ⇒ Object



664
665
666
667
# File 'lib/Qt/qtruby4.rb', line 664

def pretty_print(pp)
  str = to_s
  pp.text str.sub(/>$/, " %s>" % toString)
end

#to_dateObject



669
670
671
# File 'lib/Qt/qtruby4.rb', line 669

def to_date
  ::Date.new! to_julian_day
end