Class: DateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/auditing.rb

Instance Method Summary collapse

Instance Method Details

#show(format = nil) ⇒ Object



52
53
54
55
56
57
58
59
60
61
# File 'lib/auditing.rb', line 52

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_dateObject



48
49
50
# File 'lib/auditing.rb', line 48

def to_date
  Date.civil(self.year, self.mon, self.day)
end

#to_datetimeObject



44
45
46
# File 'lib/auditing.rb', line 44

def to_datetime
  self
end