Class: DTime::TimeUnit
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#plural ⇒ Object
readonly
Returns the value of attribute plural.
-
#value_in_seconds ⇒ Object
readonly
Returns the value of attribute value_in_seconds.
Instance Method Summary collapse
-
#initialize(unit_name, value_in_seconds) ⇒ TimeUnit
constructor
A new instance of TimeUnit.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
75 76 77 |
# File 'lib/d_time.rb', line 75 def name @name end |
#plural ⇒ Object (readonly)
Returns the value of attribute plural.
75 76 77 |
# File 'lib/d_time.rb', line 75 def plural @plural end |
#value_in_seconds ⇒ Object (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 |