mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* golf_prelude.rb (Object.const_missing): No need to delegate to
superclass. Just raise a NameError when none matches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									9343a2deb3
								
							
						
					
					
						commit
						7ad2d4cc9a
					
				
					 2 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,8 @@
 | 
			
		|||
Fri Dec 28 13:45:21 2007  Akinori MUSHA  <knu@iDaemons.org>
 | 
			
		||||
 | 
			
		||||
	* golf_prelude.rb (Object.const_missing): No need to delegate to
 | 
			
		||||
	  superclass.  Just raise a NameError when none matches.
 | 
			
		||||
 | 
			
		||||
Fri Dec 28 13:18:47 2007  Kouhei Sutou  <kou@cozmixng.org>
 | 
			
		||||
 | 
			
		||||
	* lib/rss/rss.rb, test/rss/test_version.rb: 0.2.2 -> 0.2.3.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,8 +9,8 @@ class Object
 | 
			
		|||
 | 
			
		||||
  def self.const_missing c
 | 
			
		||||
    r = /^#{c}/
 | 
			
		||||
    t = constants.sort.find{|e|r=~e}
 | 
			
		||||
    t ? const_get(t) : superclass.const_get(c)
 | 
			
		||||
    t = constants.sort.find{|e|r=~e} and return const_get(t)
 | 
			
		||||
    raise NameError, "uninitialized constant #{c}", caller(1)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def h(a='H', b='w', c='!')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue