Class: ChronicDuration::Duration
- Inherits:
-
Object
- Object
- ChronicDuration::Duration
- Defined in:
- lib/chronic_duration.rb
Instance Attribute Summary collapse
-
#days ⇒ Object
Returns the value of attribute days.
-
#hours ⇒ Object
Returns the value of attribute hours.
-
#minutes ⇒ Object
Returns the value of attribute minutes.
-
#months ⇒ Object
Returns the value of attribute months.
-
#seconds ⇒ Object
Returns the value of attribute seconds.
-
#years ⇒ Object
Returns the value of attribute years.
Instance Method Summary collapse
-
#initialize(seconds) ⇒ Duration
constructor
A new instance of Duration.
Constructor Details
#initialize(seconds) ⇒ Duration
Returns a new instance of Duration.
92 93 94 95 96 97 |
# File 'lib/chronic_duration.rb', line 92 def initialize seconds @years = @months = @days = @hours = @minutes = 0 @seconds = seconds compute_measures seconds end |
Instance Attribute Details
#days ⇒ Object
Returns the value of attribute days.
90 91 92 |
# File 'lib/chronic_duration.rb', line 90 def days @days end |
#hours ⇒ Object
Returns the value of attribute hours.
90 91 92 |
# File 'lib/chronic_duration.rb', line 90 def hours @hours end |
#minutes ⇒ Object
Returns the value of attribute minutes.
90 91 92 |
# File 'lib/chronic_duration.rb', line 90 def minutes @minutes end |
#months ⇒ Object
Returns the value of attribute months.
90 91 92 |
# File 'lib/chronic_duration.rb', line 90 def months @months end |
#seconds ⇒ Object
Returns the value of attribute seconds.
90 91 92 |
# File 'lib/chronic_duration.rb', line 90 def seconds @seconds end |
#years ⇒ Object
Returns the value of attribute years.
90 91 92 |
# File 'lib/chronic_duration.rb', line 90 def years @years end |