RubyTapas #076 - #078
076 Tail Part 5: Idiom
?
do whileっぽいループをmethodで書き換え
def each_xxx()
...
yield(yyy)
...
end
077 Tail Part 6: Process As Object
★★
さらにリファクタリング
class追加
分かりやすくなった気がする
078 Tail Part 7: Cooperating Objects
?
newlines = to_enum(:each_reverse_newline_index_with_chunk, read)
10.times do newlines.next end