Class: PrettyTime::UnitOfTime
- Inherits:
-
Object
- Object
- PrettyTime::UnitOfTime
- Defined in:
- lib/pretty_time/pretty_time.rb
Overview
Parent Class for unit’s of time for exaple: Hours, Minutes and Seconds
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ UnitOfTime
constructor
A new instance of UnitOfTime.
- #to_seconds ⇒ Object
Constructor Details
#initialize(value) ⇒ UnitOfTime
Returns a new instance of UnitOfTime.
48 49 50 |
# File 'lib/pretty_time/pretty_time.rb', line 48 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
46 47 48 |
# File 'lib/pretty_time/pretty_time.rb', line 46 def value @value end |
Instance Method Details
#to_seconds ⇒ Object
52 53 54 |
# File 'lib/pretty_time/pretty_time.rb', line 52 def to_seconds @value end |