質問編集履歴
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,4 +17,15 @@
|
|
17
17
|
@key = "test1"
|
18
18
|
@access = "test2"
|
19
19
|
end
|
20
|
+
```
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
class Sample
|
24
|
+
attr_reader :key, :access
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
@key = "test1"
|
28
|
+
@access = "test2"
|
29
|
+
end
|
30
|
+
end
|
20
31
|
```
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,7 +8,13 @@
|
|
8
8
|
|
9
9
|
[こちら](https://www.javadrive.jp/ruby/class/index6.html)を参考にしました。
|
10
10
|
|
11
|
-
|
11
|
+
まず、羅列の書き方からできませんでした。
|
12
|
+
|
12
13
|
```ruby
|
14
|
+
class Sample
|
13
|
-
attr_reader :
|
15
|
+
attr_reader :key, :access
|
16
|
+
|
17
|
+
@key = "test1"
|
18
|
+
@access = "test2"
|
19
|
+
end
|
14
20
|
```
|