[macruby-changes] [1827] MacRuby/trunk/lib/hotcocoa/mappings/sort_descriptor.rb
source_changes at macosforge.org
source_changes at macosforge.org
Mon Jun 8 23:50:14 PDT 2009
Revision: 1827
http://trac.macosforge.org/projects/ruby/changeset/1827
Author: rich at infoether.com
Date: 2009-06-08 23:50:13 -0700 (Mon, 08 Jun 2009)
Log Message:
-----------
added sort descriptor
Added Paths:
-----------
MacRuby/trunk/lib/hotcocoa/mappings/sort_descriptor.rb
Added: MacRuby/trunk/lib/hotcocoa/mappings/sort_descriptor.rb
===================================================================
--- MacRuby/trunk/lib/hotcocoa/mappings/sort_descriptor.rb (rev 0)
+++ MacRuby/trunk/lib/hotcocoa/mappings/sort_descriptor.rb 2009-06-09 06:50:13 UTC (rev 1827)
@@ -0,0 +1,13 @@
+HotCocoa::Mappings.map :sort_descriptor => :NSSortDescriptor do
+
+ defaults :ascending => true
+
+ def init_with_options(sd, opts)
+ if opts.has_key?(:selector)
+ sd.initWithKey(opts.delete(:key), ascending:opts.delete(:ascending))
+ else
+ sd.initWithKey(opts.delete(:key), ascending:opts.delete(:ascending), selector:opts.delete(:selector))
+ end
+ end
+
+end
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090608/633fc7ca/attachment.html>
More information about the macruby-changes
mailing list