[Kde-bindings] KDE/kdebindings/ruby/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Wed Aug 19 22:10:39 UTC 2009


SVN commit 1013445 by rdale:

* Added a patch from Youhei Kondou to make the to_a and kind_of? methods
  use the C++ class ancestors obtained from the smoke libary

CCMAIL: kde-bindings at kde.org


 M  +4 -0      ChangeLog  
 M  +7 -0      src/lib/Qt/qtruby4.rb  


--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #1013444:1013445
@@ -1,3 +1,7 @@
+2009-08-19  Richard Dale  <richard.j.dale at gmail.com>
+    * Added a patch from Youhei Kondou to make the to_a and kind_of? methods
+      use the C++ class ancestors obtained from the smoke libary
+
 2009-07-24  Richard Dale  <richard.j.dale at gmail.com>
 	* Replace the obsolete STR2CSTR macro with StringValueCStr to make QtRuby
 	  compile with Ruby 1.9.2. Thanks to Youhei Kondou for the patch.
--- trunk/KDE/kdebindings/ruby/qtruby/src/lib/Qt/qtruby4.rb #1013444:1013445
@@ -180,6 +180,13 @@
 			return [self] + ids.map {|id| Qt::Internal.find_class(Qt::Internal.classid2name(id))} + klasses
 		end
 
+		# Change the behaviors of is_a? and kind_of? (alias of is_a?) to use above self.ancestors method
+		# Note: this definition also affects Object#===
+		def is_a?(mod)
+			super || self.class.ancestors.include?(mod)
+		end
+		alias :kind_of? :is_a?
+
 		def methods(regular=true)
 			if !regular
 				return singleton_methods



More information about the Kde-bindings mailing list