Conclusion
剛剛建立的 example_user.rb 可以刪掉:
$ rm example_user.rb
然後提交,push,deploy:
$ git commit -am "Add a full_title helper"
$ git push
$ rake test
$ git push heroku
學到什麼?
- Ruby 提供很多處理字串的方法
- 在 Ruby 中一切都是物件
- 在 Ruby 中使用
def建立方法 - 在 Ruby 中使用
class建立類別 - Ruby 內建支持的資料型別有陣列、range 和 Hash
- Ruby 的 block 是一種彈性的接口,可以迭代可以列舉的資料
- symbol 是一種標記,類似字串,但沒有束縛
- Ruby 支持物件繼承
- 可以打開並修改 Ruby Class