Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/merry_go_round/core_ext/time.rb

Instance Method Summary collapse

Instance Method Details

#all_hourObject



29
30
31
# File 'lib/merry_go_round/core_ext/time.rb', line 29

def all_hour
  beginning_of_hour..end_of_hour
end

#all_minuteObject



25
26
27
# File 'lib/merry_go_round/core_ext/time.rb', line 25

def all_minute
  beginning_of_minute..end_of_minute
end

#beginning_of_hourObject



13
14
15
# File 'lib/merry_go_round/core_ext/time.rb', line 13

def beginning_of_hour
  change(min: 0)
end

#beginning_of_minuteObject



2
3
4
# File 'lib/merry_go_round/core_ext/time.rb', line 2

def beginning_of_minute
  change(sec: 0)
end

#end_of_hourObject



17
18
19
20
21
22
23
# File 'lib/merry_go_round/core_ext/time.rb', line 17

def end_of_hour
  change(
    :min => 59,
    :sec => 59,
    :usec => Rational(999999999, 1000)
  )
end

#end_of_minuteObject



6
7
8
9
10
11
# File 'lib/merry_go_round/core_ext/time.rb', line 6

def end_of_minute
  change(
    sec: 59,
    usec: Rational(999999999, 1000)
  )
end