2.2.0 :004 > ':xyz'.split(/:/)[0]
=> ""
2.2.0 :005 > ''.split(/:/)[0]
=> nil
2.2.0 :006 > 'xyz'.split(/:/)[0]
=> "xyz"
2.2.0 :001 > weak_key = lambda {|c| c.split(/:/, 2)[0]}
2.2.0 :002 > weak_key('xyz:1986')
NoMethodError: undefined method `weak_key' for main:Object
2.2.0 :003 > def weak_key(x
(
Read more... )