Class: Crony::Formatters::HourFormatter
- Inherits:
-
CronStruct
- Object
- OpenStruct
- CronStruct
- Crony::Formatters::HourFormatter
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
#c ⇒ Object
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
|
#e ⇒ Object
8
9
10
|
# File 'lib/crony/formatters/hour_formatter.rb', line 8
def e
'every hour'
end
|
#f ⇒ Object
12
13
14
|
# File 'lib/crony/formatters/hour_formatter.rb', line 12
def f
"#{v} between #{r}"
end
|
#r ⇒ Object
16
17
18
|
# File 'lib/crony/formatters/hour_formatter.rb', line 16
def r
"#{start.two_digits}:00 and #{stop.two_digits}:59"
end
|
#u ⇒ Object
22
23
24
|
# File 'lib/crony/formatters/hour_formatter.rb', line 22
def u
"#{v} starting at #{start.two_digits}:00"
end
|
#v ⇒ Object
26
27
28
|
# File 'lib/crony/formatters/hour_formatter.rb', line 26
def v
"every #{frequency.ordinal} hour"
end
|