Class: DateTime
- Inherits:
-
Object
- Object
- DateTime
- Defined in:
- lib/mordor.rb
Instance Method Summary collapse
Instance Method Details
#show(format = nil) ⇒ Object
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/mordor.rb', line 55 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
51 52 53 |
# File 'lib/mordor.rb', line 51 def to_date Date.civil(self.year, self.mon, self.day) end |
#to_datetime ⇒ Object
47 48 49 |
# File 'lib/mordor.rb', line 47 def to_datetime self end |