Class: Crony::Formatters::DayOfMonthFormatter
- Inherits:
-
CronStruct
- Object
- OpenStruct
- CronStruct
- Crony::Formatters::DayOfMonthFormatter
show all
- Defined in:
- lib/crony/formatters/day_of_month_formatter.rb
Instance Method Summary
collapse
Methods inherited from CronStruct
#collection?, #every?, #format, #frequency?, #range?, #single_element, #single_element?, #unbounded_range?
Instance Method Details
#c(lead_in = true) ⇒ Object
16
17
18
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 16
def c(lead_in=true)
"#{"on the " if lead_in}#{collection.map(&:ordinal).to_sentence}"
end
|
#e ⇒ Object
20
21
22
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 20
def e
"on every day"
end
|
#f ⇒ Object
24
25
26
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 24
def f
"#{v} from #{range}"
end
|
#l ⇒ Object
28
29
30
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 28
def l
"on the last day"
end
|
#ordinal ⇒ Object
4
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 4
def ordinal; self.single_element.ordinal; end
|
#r ⇒ Object
32
33
34
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 32
def r
"on #{range}"
end
|
#range ⇒ Object
6
7
8
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 6
def range
"the #{self.start.ordinal} to the #{self.stop.ordinal}"
end
|
#s(lead_in = true) ⇒ Object
36
37
38
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 36
def s(lead_in=true)
"#{"on the " if lead_in}#{ordinal}"
end
|
#sym ⇒ Object
10
11
12
13
14
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 10
def sym
return 'w' if !!nearest
return 'l' if !!last
super
end
|
#u ⇒ Object
40
41
42
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 40
def u
"#{v} starting on the #{start.ordinal}"
end
|
#v ⇒ Object
44
45
46
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 44
def v
"on every #{frequency.ordinal} day"
end
|
#w ⇒ Object
48
49
50
|
# File 'lib/crony/formatters/day_of_month_formatter.rb', line 48
def w
"on the weekday closest to the #{ordinal}"
end
|