[MacRuby-devel] [MacRuby] #367: Error in color.rb

MacRuby ruby-noreply at macosforge.org
Wed Oct 7 23:30:05 PDT 2009


#367: Error in color.rb
--------------------------------+-------------------------------------------
 Reporter:  i.script@…          |       Owner:  lsansonetti@…        
     Type:  defect              |      Status:  new                  
 Priority:  blocker             |   Milestone:  MacRuby 0.5          
Component:  MacRuby             |    Keywords:  Hotcocoa Color Error 
--------------------------------+-------------------------------------------
 The file color.rb inside the hotcocoa/graphics directors is using a wrong
 class method!

 Following code has to be changed:

 COLORNAMES.each_key do |name|
       (class << self; self; end).define_method(name) do
         named(name)
       end
     end


 In this case define_singleton_method is the way to go.

 COLORNAMES.each_key do |name|
       (class << self; self; end).define_singleton_method(name) do
         named(name)
       end
     end

 Tom Fuerstner

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/367>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list