commit | 932ba51ac81c748eceb22307f2418d5292f5f8d0 | [log] [tgz] |
---|---|---|
author | Ellen Lee <ellen.lee@alphacamp.co> | Thu Nov 02 14:51:07 2017 +0800 |
committer | Ellen Lee <ellen.lee@alphacamp.co> | Thu Nov 02 14:51:07 2017 +0800 |
tree | 76d0c85ecf4f63b0d3a3702f04ce417816d2d04e | |
parent | 90e5ce9d16534b6cb1328d79e916186bcfc30967 [diff] [blame] |
fix the sequence of parameters
diff --git a/04_holy_knight.rb b/04_holy_knight.rb index 6f2bb1a..a4f94d2 100644 --- a/04_holy_knight.rb +++ b/04_holy_knight.rb
@@ -2,7 +2,7 @@ attr_accessor :hp, :name # 設定物件外部可以直接使用和修改 name 和 hp 的 attributes - def initialize(name,ap,hp) + def initialize(name, hp, ap) @name = name # 設定一個名為 name(名稱)的 attribute @hp = hp # 設定一個名為 hp(生命值)的 attribute @ap = ap # 設定一個名為 ap(攻擊值)的 attribute