## Learn Ruby The Hard Way

### 前言：

1. 如何知道require lib的路徑：

2. exercise13中，STDIN.gets 與一般gets的不同

Important: Also notice that we're using STDIN.gets instead of plain 'ol gets. That is because if there is stuff in ARGV, the default gets method tries to treat the first one as a file and read from that. To read from the user's input (i.e., stdin) in such a situation, you have to use it STDIN.gets explicitly.

ex.
ex13.rb first second third

3. exercise 16的加分題：

difference between method and funtion:

A method is on an object.
A function is independent of an object.

For Java, there are only methods.
For C, there are only functions.
For Ruby, there are only methods.

For C++ it would depend on whether or not you're in a class.

4. exercise 20 關於File中的seek函數

SEEK_SET: 指向offset所指定的位置(從0開始)
SEEK_CUR: 指向當前位置加上offset值後的位置
SEEK_END: 指向offset所指定位置，從文字最後面開始(offset須用負數)

SET與END應該都不難理解，來看一下CUR

5. class中method self的使用