[ruby] #40: Create KVC-compliant setter when using attr_accessor.
#40: Create KVC-compliant setter when using attr_accessor. ----------------------------+----------------------------------------------- Reporter: alloye@mac.com | Owner: lsansonetti@apple.com Type: enhancement | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ----------------------------+----------------------------------------------- When using attr_accessor, a KVC-compliant setter method is not registered. Adding this feature would allow Ruby classes to be defined using the same semantics as Objective-C 2.0 classes that employ synthesized properties. {{{ [~]: irb
framework "Cocoa" => true class Person attr_accessor :name def initialize(name="") @name = name end end => nil p = Person.new("Wayne Steele") => #<Person:0x1847180 @name="Wayne Steele"> p.respond_to?("name=") => true p.respond_to?("setName:") => false }}}
-- Ticket URL: <http://trac.macosforge.org/projects/ruby/ticket/40> ruby <http://ruby.macosforge.org/>
#40: Create KVC-compliant setter when using attr_accessor. ----------------------------+----------------------------------------------- Reporter: alloye@mac.com | Owner: lsansonetti@apple.com Type: enhancement | Status: new Priority: major | Milestone: MacRuby 1.0 Component: MacRuby | Resolution: Keywords: | ----------------------------+----------------------------------------------- Comment (by lsansonetti@apple.com): You're right, I was thinking the same thing a while ago. This would also eliminate the need of the ib_outlet method. -- Ticket URL: <http://trac.macosforge.org/projects/ruby/ticket/40#comment:1> ruby <http://ruby.macosforge.org/>
participants (1)
-
ruby