Class: Time

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

Instance Method Summary collapse

Instance Method Details

#compactObject



11
12
13
# File 'lib/compact_time.rb', line 11

def compact
	"%02d %s%02d %s%02d%02d".freeze % compact_array
end

#compact_arrayObject



5
6
7
# File 'lib/compact_time.rb', line 5

def compact_array
	[cpt_year % 100, cpt_season, cpt_week, cpt_day, hour, min]
end

#fullObject



14
15
16
# File 'lib/compact_time.rb', line 14

def full
	"%d %s%02d %s%02d%02d%s %02d %06d".freeze % full_array
end

#full_arrayObject



8
9
10
# File 'lib/compact_time.rb', line 8

def full_array
	[cpt_year, cpt_season, cpt_week, cpt_day, hour, min, cpt_offset, sec, usec]
end

#till_nowObject



4
# File 'lib/compact_time.rb', line 4

def till_now; self.class.now - self end