Issue #4147 has been updated by yhara (Yutaka HARA).

Target version changed from 2.0.0 to next minor


----------------------------------------
Feature #4147: Array#sample ??ч????帥?????絎??????????
https://bugs.ruby-lang.org/issues/4147#change-31575

Author: oj (Yoji Ojima)
Status: Assigned
Priority: Normal
Assignee: shyouhei (Shyouhei Urabe)
Category: 
Target version: next minor


=begin
 Array#sample ????????????羝<???????????????????????祉????ゃ??荀?膣???????帥?????篏????????????????????с??????????????
 
 筝?荐????泣?潟?????с??"紊у??" ??? "???" ??? 1000 ?????腆?????ч?御?????????????????????????????с?????
 
 omikuji_box = [
   {:name => "紊у??", :weight => 1000},
   {:name => "筝??", :weight => 100},
   {:name => "絨???", :weight => 10},
   {:name => "???",   :weight => 1}
 ]
 omikuji = omikuji_box.sample {|v| v[:weight] }
 puts omikuji[:name]
=end



-- 
http://bugs.ruby-lang.org/