Class: Time
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_date ⇒ Object
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 |