[macruby-changes] [743] MacRuby/trunk/lib/hotcocoa/kvo_accessors.rb

source_changes at macosforge.org source_changes at macosforge.org
Fri Nov 14 08:23:19 PST 2008


Revision: 743
          http://trac.macosforge.org/projects/ruby/changeset/743
Author:   ben at tanjero.com
Date:     2008-11-14 08:23:17 -0800 (Fri, 14 Nov 2008)
Log Message:
-----------
Fixed up key-name-ificiation of selectors for KVO accessors.

Modified Paths:
--------------
    MacRuby/trunk/lib/hotcocoa/kvo_accessors.rb

Modified: MacRuby/trunk/lib/hotcocoa/kvo_accessors.rb
===================================================================
--- MacRuby/trunk/lib/hotcocoa/kvo_accessors.rb	2008-11-14 12:54:43 UTC (rev 742)
+++ MacRuby/trunk/lib/hotcocoa/kvo_accessors.rb	2008-11-14 16:23:17 UTC (rev 743)
@@ -1,7 +1,8 @@
 class Object
 
     def self.kvo_array(key, &b)
-        capitalized_key = key.to_s.capitalize
+        key = key.to_s
+        capitalized_key = key[0].capitalize + key[1..-1]
         signatures = { :size      => { selector: :"countOf#{capitalized_key}",                  type_signature: "i@:",   flip: false },
                        :[]        => { selector: :"objectIn#{capitalized_key}AtIndex:",         type_signature: "@@:i",  flip: false },
                        :insert    => { selector: :"insertObject:in#{capitalized_key}AtIndex:",  type_signature: "v@:@i", flip: true  },
@@ -11,7 +12,8 @@
     end
 
     def self.kvo_set(key, &b)
-        capitalized_key = key.to_s.capitalize
+        key = key.to_s
+        capitalized_key = key[0].capitalize + key[1..-1]
         signatures = { :add       => { selector: :"add#{capitalized_key}Object:",    type_signature: "v@:@", flip: false },
                        :delete    => { selector: :"remove#{capitalized_key}Object:", type_signature: "v@:@", flip: false},
                        :merge     => { selector: :"add#{capitalized_key}:",          type_signature: "v@:@", flip: false },
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20081114/dc9fe55f/attachment.html>


More information about the macruby-changes mailing list