Skip to content

Commit 4d1aaf8

Browse files
authored
Merge pull request #513 from seejohnrun/update-readmy-hash-syntax
Update README hash syntax
2 parents fe567c8 + 3c5f77d commit 4d1aaf8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@ schedule.previous_occurrence(from_time)
9191
schedule.previous_occurrences(4, from_time)
9292

9393
# or include prior occurrences with a duration overlapping from_time
94-
schedule.next_occurrences(4, from_time, :spans => true)
95-
schedule.occurrences_between(from_time, to_time, :spans => true)
94+
schedule.next_occurrences(4, from_time, spans: true)
95+
schedule.occurrences_between(from_time, to_time, spans: true)
9696

9797
# or give the schedule a duration and ask if occurring_at?
98-
schedule = IceCube::Schedule.new(now, :duration => 3600)
98+
schedule = IceCube::Schedule.new(now, duration: 3600)
9999
schedule.add_recurrence_rule IceCube::Rule.daily
100100
schedule.occurring_at?(now + 1800) # true
101101
schedule.occurring_between?(t1, t2)
102102

103103
# using end_time also sets the duration
104-
schedule = IceCube::Schedule.new(start = Time.now, :end_time => start + 3600)
104+
schedule = IceCube::Schedule.new(start = Time.now, end_time: start + 3600)
105105
schedule.add_recurrence_rule IceCube::Rule.daily
106106
schedule.occurring_at?(start + 3599) # true
107107
schedule.occurring_at?(start + 3600) # false
@@ -162,7 +162,7 @@ ice_cube can provide ical or string representations of individual rules, or the
162162
whole schedule.
163163

164164
```ruby
165-
rule = IceCube::Rule.daily(2).day_of_week(:tuesday => [1, -1], :wednesday => [2])
165+
rule = IceCube::Rule.daily(2).day_of_week(tuesday: [1, -1], wednesday: [2])
166166

167167
rule.to_ical # 'FREQ=DAILY;INTERVAL=2;BYDAY=1TU,-1TU,2WE'
168168

@@ -218,12 +218,12 @@ month (e.g. no occurrences in February for `day_of_month(31)`).
218218

219219
```ruby
220220
# every month on the first and last tuesdays of the month
221-
schedule.add_recurrence_rule IceCube::Rule.monthly.day_of_week(:tuesday => [1, -1])
221+
schedule.add_recurrence_rule IceCube::Rule.monthly.day_of_week(tuesday: [1, -1])
222222

223223
# every other month on the first monday and last tuesday
224224
schedule.add_recurrence_rule IceCube::Rule.monthly(2).day_of_week(
225-
:monday => [1],
226-
:tuesday => [-1]
225+
monday: [1],
226+
tuesday: [-1]
227227
)
228228

229229
# for programmatic convenience (same as above)
@@ -270,7 +270,7 @@ schedule.add_recurrence_rule IceCube::Rule.hourly(2).day(:monday)
270270
schedule.add_recurrence_rule IceCube::Rule.minutely(10)
271271

272272
# every hour and a half, on the last tuesday of the month
273-
schedule.add_recurrence_rule IceCube::Rule.minutely(90).day_of_week(:tuesday => [-1])
273+
schedule.add_recurrence_rule IceCube::Rule.minutely(90).day_of_week(tuesday: [-1])
274274
```
275275

276276
### Secondly (every N seconds)

0 commit comments

Comments
 (0)