#メソッドチェインとは 流れるようなインターフェース
3.weeks.ago
3.weeks.ago.saturday?
Product.whie(:price => 100 )
Product.order(:price).limit(10).offset(0)
(0..9).map{|i| i +1 }
(0..9).map{|i| i +1 }.reduce(:+)
配列の各要素に対してブロックを実行
a = [10, 20, 30, 40, 50]
a.map{|i| i +1 }
ブロックを使って繰り返し計算を行うのに使う
numbers = [2, 6, 5, 3, 7, 8, 1, 9, 4]
puts numbers.reduce(:+)