Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/nickel/construct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class RecurrenceConstruct < Construct
attr_accessor :repeats, :repeats_on

def interpret
if [:daily, :altdaily, :threedaily].include?(repeats)
if %i(daily altdaily threedaily).include?(repeats)
interpret_daily_variant
elsif [:weekly, :altweekly, :threeweekly].include?(repeats)
elsif %i(weekly altweekly threeweekly).include?(repeats)
interpret_weekly_variant
elsif [:daymonthly, :altdaymonthly, :threedaymonthly].include?(repeats)
elsif %i(daymonthly altdaymonthly threedaymonthly).include?(repeats)
interpret_daymonthly_variant
elsif [:datemonthly, :altdatemonthly, :threedatemonthly].include?(repeats)
elsif %i(datemonthly altdatemonthly threedatemonthly).include?(repeats)
interpret_datemonthly_variant
else
fail StandardError, 'self is an invalid variant, check value of self.repeats'
Expand All @@ -58,11 +58,11 @@ def get_interval
end

def interval
if [:daily, :weekly, :daymonthly, :datemonthly].include?(repeats)
if %i(daily weekly daymonthly datemonthly).include?(repeats)
1
elsif [:altdaily, :altweekly, :altdaymonthly, :altdatemonthly].include?(repeats)
elsif %i(altdaily altweekly altdaymonthly altdatemonthly).include?(repeats)
2
elsif [:threedaily, :threeweekly, :threedaymonthly, :threedatemonthly].include?(repeats)
elsif %i(threedaily threeweekly threedaymonthly threedatemonthly).include?(repeats)
3
else
fail StandardError, 'self.repeats is invalid!!'
Expand Down