Class: Time

Inherits:
Object show all
Defined in:
lib/custom_class_objects/ext_time.rb

Instance Method Summary collapse

Instance Method Details

#before_year(year_count = 1) ⇒ Object



6
7
8
9
# File 'lib/custom_class_objects/ext_time.rb', line 6

def before_year(year_count = 1)
  Time.mktime(self.year - year_count,
              self.month, self.day, self.hour, self.min, self.sec)
end

#to_dateObject



2
3
4
# File 'lib/custom_class_objects/ext_time.rb', line 2

def to_date
  return Date.new(self.year, self.month, self.day)
end