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.



630
631
632
633
634
635
636
# File 'lib/Qt/qtruby4.rb', line 630

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



638
639
640
641
# File 'lib/Qt/qtruby4.rb', line 638

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

#pretty_print(pp) ⇒ Object



643
644
645
646
# File 'lib/Qt/qtruby4.rb', line 643

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

#to_dateObject



648
649
650
# File 'lib/Qt/qtruby4.rb', line 648

def to_date
	::Date.new! to_julian_day
end