Module: TimeCrisis::Support::Conversions::Date

Defined in:
lib/time_crisis/support/conversions.rb

Instance Method Summary collapse

Instance Method Details

#to_dateObject



5
6
7
# File 'lib/time_crisis/support/conversions.rb', line 5

def to_date
  self
end

#to_datetimeObject



13
14
15
# File 'lib/time_crisis/support/conversions.rb', line 13

def to_datetime
  ::DateTime.civil(year, month, day, 0, 0, 0, 0)
end

#to_time(form = :local) ⇒ Object



9
10
11
# File 'lib/time_crisis/support/conversions.rb', line 9

def to_time(form = :local)
  ::Time.send(form, year, month, day)
end