Class: Numeric
Instance Method Summary collapse
- #am ⇒ Object
- #day ⇒ Object
- #days ⇒ Object
- #hour ⇒ Object
- #hours ⇒ Object
- #is_multiple_of?(num) ⇒ Boolean
- #minute ⇒ Object
- #minutes ⇒ Object
- #pm ⇒ Object
- #second ⇒ Object
- #seconds ⇒ Object
- #week ⇒ Object
- #weeks ⇒ Object
Instance Method Details
#am ⇒ Object
42 43 44 |
# File 'lib/days_and_times/numeric.rb', line 42 def am Time.parse("#{self}:00:00") end |
#day ⇒ Object
13 14 15 |
# File 'lib/days_and_times/numeric.rb', line 13 def day self.days end |
#days ⇒ Object
10 11 12 |
# File 'lib/days_and_times/numeric.rb', line 10 def days self == 1 ? Day.new : Days.new(self) end |
#hour ⇒ Object
20 21 22 |
# File 'lib/days_and_times/numeric.rb', line 20 def hour self.hours end |
#hours ⇒ Object
17 18 19 |
# File 'lib/days_and_times/numeric.rb', line 17 def hours self == 1 ? Hour.new : Hours.new(self) end |
#is_multiple_of?(num) ⇒ Boolean
38 39 40 |
# File 'lib/days_and_times/numeric.rb', line 38 def is_multiple_of?(num) self % num == 0 end |
#minute ⇒ Object
27 28 29 |
# File 'lib/days_and_times/numeric.rb', line 27 def minute self.minutes end |
#minutes ⇒ Object
24 25 26 |
# File 'lib/days_and_times/numeric.rb', line 24 def minutes self == 1 ? Minute.new : Minutes.new(self) end |
#pm ⇒ Object
45 46 47 |
# File 'lib/days_and_times/numeric.rb', line 45 def pm Time.parse("#{self+12}:00:00") end |
#second ⇒ Object
34 35 36 |
# File 'lib/days_and_times/numeric.rb', line 34 def second self.seconds end |
#seconds ⇒ Object
31 32 33 |
# File 'lib/days_and_times/numeric.rb', line 31 def seconds self == 1 ? Second.new : Seconds.new(self) end |
#week ⇒ Object
6 7 8 |
# File 'lib/days_and_times/numeric.rb', line 6 def week self.weeks end |