Issue #4147 has been updated by Shyouhei Urabe.


??<????c????????篁??????????≪?泣?ゃ?潟???????????????ゆ??緇??????障?ゃ???????????????????莨若????с?????????????х??????c?????????肴???????????с????????????????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: 


=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