Class: DateTime
- Inherits:
-
Object
- Object
- DateTime
- Defined in:
- lib/mordor.rb
Instance Method Summary collapse
Instance Method Details
#show(format = nil) ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/mordor.rb', line 54 def show(format = nil) case format when :human strftime("%d-%m-%Y %H:%M") when :full strftime("%d-%m-%Y %H:%M:%S") else to_s end end |
#to_date ⇒ Object
50 51 52 |
# File 'lib/mordor.rb', line 50 def to_date Date.civil(self.year, self.mon, self.day) end |
#to_datetime ⇒ Object
46 47 48 |
# File 'lib/mordor.rb', line 46 def to_datetime self end |