Class: BaseDate
- Inherits:
-
Object
- Object
- BaseDate
- Defined in:
- lib/continuance/base_date.rb
Overview
To calculate duration in Ruby we need to calculate time differences, but in Ruby when you are dealing with finer units like days, hours, minutes etc we need to make sure the base YY-MM-DD is set to 1970-01-01 to remove potential errors
Instance Attribute Summary collapse
-
#val ⇒ Object
readonly
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize ⇒ BaseDate
constructor
A new instance of BaseDate.
Constructor Details
#initialize ⇒ BaseDate
Returns a new instance of BaseDate.
10 11 12 |
# File 'lib/continuance/base_date.rb', line 10 def initialize @val = Time.new(1970, 1, 1) end |
Instance Attribute Details
#val ⇒ Object (readonly)
Returns the value of attribute val.
8 9 10 |
# File 'lib/continuance/base_date.rb', line 8 def val @val end |