mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	[DOC] Update Proc.new without a block [ci skip]
[Feature #10499] [Feature #15554]
This commit is contained in:
		
							parent
							
								
									cf4a6b5e7b
								
							
						
					
					
						commit
						8da7f4abc7
					
				
					 1 changed files with 6 additions and 9 deletions
				
			
		
							
								
								
									
										15
									
								
								proc.c
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								proc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -799,18 +799,15 @@ proc_new(VALUE klass, int8_t is_lambda, int8_t kernel)
 | 
			
		|||
/*
 | 
			
		||||
 *  call-seq:
 | 
			
		||||
 *     Proc.new {|...| block } -> a_proc
 | 
			
		||||
 *     Proc.new                -> a_proc
 | 
			
		||||
 *
 | 
			
		||||
 *  Creates a new Proc object, bound to the current context. Proc::new
 | 
			
		||||
 *  may be called without a block only within a method with an
 | 
			
		||||
 *  attached block, in which case that block is converted to the Proc
 | 
			
		||||
 *  object.
 | 
			
		||||
 *  Creates a new Proc object, bound to the current context.
 | 
			
		||||
 *
 | 
			
		||||
 *     def proc_from
 | 
			
		||||
 *       Proc.new
 | 
			
		||||
 *     end
 | 
			
		||||
 *     proc = proc_from { "hello" }
 | 
			
		||||
 *     proc = Proc.new { "hello" }
 | 
			
		||||
 *     proc.call   #=> "hello"
 | 
			
		||||
 *
 | 
			
		||||
 *  Raises ArgumentError if called without a block.
 | 
			
		||||
 *
 | 
			
		||||
 *     Proc.new    #=> ArgumentError
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static VALUE
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue