LoginSignup
1
0

More than 5 years have passed since last update.

Rubyの便利メソッドstep

Posted at

2017/1/24

step

offset的なruby method
range iterator

(1:00..4:00).step(60*60) do |time|
    p time
end

#1時間ごと出力する

# 1:00
# 2:00
# 3:00
# 4:00
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0