Class: DTime::TimeUnit

Inherits:
Object show all
Defined in:
lib/d_time.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unit_name, value_in_seconds) ⇒ TimeUnit

Returns a new instance of TimeUnit.



70
71
72
73
74
# File 'lib/d_time.rb', line 70

def initialize ( unit_name, value_in_seconds )
  @name = unit_name
  @plural = unit_name.to_s.pluralize.to_sym
  @value_in_seconds = value_in_seconds
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



75
76
77
# File 'lib/d_time.rb', line 75

def name
  @name
end

#pluralObject (readonly)

Returns the value of attribute plural.



75
76
77
# File 'lib/d_time.rb', line 75

def plural
  @plural
end

#value_in_secondsObject (readonly)

Returns the value of attribute value_in_seconds.



75
76
77
# File 'lib/d_time.rb', line 75

def value_in_seconds
  @value_in_seconds
end