Class: Time

Inherits:
Object show all
Defined in:
lib/dohutil/to_display.rb,
lib/dohutil/core_ext/inspect.rb,
lib/dohutil/core_ext/datewithtime.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.zowObject



34
35
36
# File 'lib/dohutil/core_ext/datewithtime.rb', line 34

def self.zow
  now.zowify
end

Instance Method Details

#inspectObject



20
21
22
# File 'lib/dohutil/core_ext/inspect.rb', line 20

def inspect
  "#<Time:#{strftime('%F %X %z')}>"
end

#next_second(n = 1) ⇒ Object



42
43
44
# File 'lib/dohutil/core_ext/datewithtime.rb', line 42

def next_second(n = 1)
  self + n
end

#prev_second(n = 1) ⇒ Object



46
47
48
# File 'lib/dohutil/core_ext/datewithtime.rb', line 46

def prev_second(n = 1)
  self - n
end

#to_displayObject



16
17
18
# File 'lib/dohutil/to_display.rb', line 16

def to_display
  strftime('%m/%d/%Y %I:%M%P')
end

#zowifyObject



38
39
40
# File 'lib/dohutil/core_ext/datewithtime.rb', line 38

def zowify
  self.class.new(year, month, mday, hour, min, sec, 0)
end