Class: PrettyTime::UnitOfTime

Inherits:
Object
  • Object
show all
Defined in:
lib/pretty_time/pretty_time.rb

Overview

Parent Class for unit’s of time for exaple: Hours, Minutes and Seconds

Direct Known Subclasses

Hours, Minutes, Seconds

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject

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_secondsObject



52
53
54
# File 'lib/pretty_time/pretty_time.rb', line 52

def to_seconds
  @value 
end