Notes posted by xxjjnn

RSS feed
November 3, 2015 - (v4.2.1)
0 thanks

Possible bug

Works as expected for non bang methods

>  a={x:1, y:2, z:3}                                                                      
=> {:x=>1, :y=>2, :z=>3}

> a.slice(:y)                                                                             
=> {:y=>2}

> a.except(:y)                                                                            
=> {:x=>1, :z=>3}

Bug on slice! it behaves like except!

> a.clone.slice!(:y)                                                                                                                                                                                
=> {:x=>1, :z=>3}

> a.clone.except!(:y)                                                                                                                                                                               
=> {:x=>1, :z=>3}

slice! should return {:y=>2} and modify a to no longer have it