Class: BaseDate

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeBaseDate

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

#valObject (readonly)

Returns the value of attribute val.



8
9
10
# File 'lib/continuance/base_date.rb', line 8

def val
  @val
end