Class: Time

Inherits:
Object show all
Defined in:
lib/ruby/to_date.rb,
lib/ruby/to_time.rb

Instance Method Summary collapse

Instance Method Details

#to_dateObject



3
4
5
# File 'lib/ruby/to_date.rb', line 3

def to_date
  Date.civil(year, month, day)
end

#to_timeTime

Returns:



4
5
6
# File 'lib/ruby/to_time.rb', line 4

def to_time
  self
end