ruby koans洗牌正在发生什么

时间:2015-06-17 12:46:16

标签: ruby-on-rails ruby shuffle

无法找出ruby koans中的这一个。也许有人可以提供帮助?The answers you seek... undefined method to_a_shuffle'对于1..5:范围

请冥想以下代码:   /Users/nicholaskelly/koans/koans/about_dice_project.rb:12:in roll' /Users/nicholaskelly/koans/koans/about_dice_project.rb:24:in test_rolling_the_dice_returns_a_set_of_integers_between_1_and_6'`

这里是about_dice_project.rb12:

@values = (1..number).to_a_shuffle

1 个答案:

答案 0 :(得分:2)

没有名为{ "aggs": { "tagfilter": { "filter": { "terms": { "tags": [ "1", "2", "3" ] } }, "aggs": { "mytags": { "terms": { "field": "tags" } } } } } } 的方法。您需要将to_a_shuffle应用于范围,然后to_a该数组。

shuffle