Class: Crony::Formatters::HourFormatter

Inherits:
CronStruct
  • Object
show all
Defined in:
lib/crony/formatters/hour_formatter.rb

Instance Method Summary collapse

Methods inherited from CronStruct

#collection?, #every?, #format, #frequency?, #range?, #single_element, #single_element?, #sym, #unbounded_range?

Instance Method Details

#cObject Also known as: s



4
5
6
# File 'lib/crony/formatters/hour_formatter.rb', line 4

def c
  collection.map{|hour| "#{hour.two_digits}:00 and #{hour.two_digits}:59" }.to_sentence
end

#eObject



8
9
10
# File 'lib/crony/formatters/hour_formatter.rb', line 8

def e
  'every hour'
end

#fObject



12
13
14
# File 'lib/crony/formatters/hour_formatter.rb', line 12

def f
  "#{v} between #{r}"
end

#rObject



16
17
18
# File 'lib/crony/formatters/hour_formatter.rb', line 16

def r
  "#{start.two_digits}:00 and #{stop.two_digits}:59"
end

#uObject



22
23
24
# File 'lib/crony/formatters/hour_formatter.rb', line 22

def u
  "#{v} starting at #{start.two_digits}:00"
end

#vObject



26
27
28
# File 'lib/crony/formatters/hour_formatter.rb', line 26

def v
  "every #{frequency.ordinal} hour"
end