All pastes #2126451 Raw Edit

Anonymous

public text v1 · immutable
#2126451 ·published 2012-03-09 18:08 UTC
rendered paste body
>> (1..10)
=> 1..10
>> (1..10).find {|i| i == 2}
=> 2
>> (1..10).find 
LocalJumpError: no block given
	from (irb):3:in `find'
	from (irb):3:in `each'
	from (irb):3:in `find'
	from (irb):3
>> (1..10).find {}
=> nil
>> (1..10).find {|i|}
=> nil
>> (1..10).find {|i| i}
=> 1
>> (1..10).find {|i| i == 2}
=> 2
>> (1..10).find {|i| i > 2}
=> 3
>> (1..10).find {|i| if i > 2}
>> (1..10).find {|i| i > 2}
>>