Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/duration/numeric.rb
Instance Method Summary collapse
- #dday ⇒ Object
- #ddays ⇒ Object
- #dhour ⇒ Object
- #dhours ⇒ Object
- #dminute ⇒ Object
- #dminutes ⇒ Object
- #dmonth ⇒ Object
- #dmonths ⇒ Object
- #dsecond ⇒ Object
- #dseconds ⇒ Object
- #duration ⇒ Object
- #dweek ⇒ Object
- #dweeks ⇒ Object
- #dyear ⇒ Object
- #dyears ⇒ Object
- #is_multiple_of?(num) ⇒ Boolean
Instance Method Details
#dday ⇒ Object
32 33 34 |
# File 'lib/duration/numeric.rb', line 32 def dday self.ddays end |
#ddays ⇒ Object
29 30 31 |
# File 'lib/duration/numeric.rb', line 29 def ddays self == 1 ? Day.new : Days.new(self) end |
#dhour ⇒ Object
39 40 41 |
# File 'lib/duration/numeric.rb', line 39 def dhour self.dhours end |
#dhours ⇒ Object
36 37 38 |
# File 'lib/duration/numeric.rb', line 36 def dhours self == 1 ? Hour.new : Hours.new(self) end |
#dminute ⇒ Object
46 47 48 |
# File 'lib/duration/numeric.rb', line 46 def dminute self.dminutes end |
#dminutes ⇒ Object
43 44 45 |
# File 'lib/duration/numeric.rb', line 43 def dminutes self == 1 ? Minute.new : Minutes.new(self) end |
#dmonth ⇒ Object
18 19 20 |
# File 'lib/duration/numeric.rb', line 18 def dmonth self.dmonths end |
#dmonths ⇒ Object
15 16 17 |
# File 'lib/duration/numeric.rb', line 15 def dmonths self == 1 ? Month.new : Months.new(self) end |
#dsecond ⇒ Object
53 54 55 |
# File 'lib/duration/numeric.rb', line 53 def dsecond self.dseconds end |
#dseconds ⇒ Object
50 51 52 |
# File 'lib/duration/numeric.rb', line 50 def dseconds self == 1 ? Second.new : Seconds.new(self) end |
#duration ⇒ Object
4 5 6 |
# File 'lib/duration/numeric.rb', line 4 def duration Duration.new self end |
#dweek ⇒ Object
25 26 27 |
# File 'lib/duration/numeric.rb', line 25 def dweek self.dweeks end |
#dweeks ⇒ Object
22 23 24 |
# File 'lib/duration/numeric.rb', line 22 def dweeks self == 1 ? Week.new : Weeks.new(self) end |
#dyear ⇒ Object
11 12 13 |
# File 'lib/duration/numeric.rb', line 11 def dyear self.dyears end |
#dyears ⇒ Object
8 9 10 |
# File 'lib/duration/numeric.rb', line 8 def dyears self == 1 ? Year.new : Years.new(self) end |
#is_multiple_of?(num) ⇒ Boolean
57 58 59 |
# File 'lib/duration/numeric.rb', line 57 def is_multiple_of?(num) self % num == 0 end |