Issue #4147 has been updated by Shyouhei Urabe.


??障?????????????????ゃ?????障???????????????≪?泣?ゃ?潟??????????????????????с???????????羂?????????障?????
?????????<???????????????????????c?????障?????????????ャ??с??????????障?????c?????????????????祉?????????????с?????
----------------------------------------
Feature #4147: Array#sample ??ч????帥?????絎??????????
http://redmine.ruby-lang.org/issues/4147

Author: Yoji Ojima
Status: Assigned
Priority: Normal
Assignee: Shyouhei Urabe
Category: 
Target version: 2.0.0


=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://redmine.ruby-lang.org