質問編集履歴
3
誤字の修正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
2
誤字の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,9 +14,11 @@
|
|
14
14
|
|
15
15
|
エラーメッセージ
|
16
16
|
|
17
|
+
NoMethodError (undefined method `sample' for nil:NilClass):
|
18
|
+
|
19
|
+
|
20
|
+
|
17
21
|
```
|
18
|
-
|
19
|
-
NoMethodError (undefined method `sample' for nil:NilClass):
|
20
22
|
|
21
23
|
|
22
24
|
|
1
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -52,6 +52,12 @@
|
|
52
52
|
|
53
53
|
end
|
54
54
|
|
55
|
+
hash_result = JSON.parse result #レスポンスが文字列なのでhashにパースする
|
56
|
+
|
57
|
+
shops = hash_result["rest"] #ここでお店情報が入った配列となる
|
58
|
+
|
59
|
+
shop = shops.sample #任意のものを一個選ぶ
|
60
|
+
|
55
61
|
```
|
56
62
|
|
57
63
|
|