mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-23 02:30:12 +01:00
19 lines
556 B
Ruby
19 lines
556 B
Ruby
|
|
module RecurringTodos
|
||
|
|
|
||
|
|
class DailyRecurringTodosBuilder < AbstractRecurringTodosBuilder
|
||
|
|
attr_reader :recurring_todo, :pattern
|
||
|
|
|
||
|
|
def initialize(user, attributes)
|
||
|
|
super(user, attributes)
|
||
|
|
@pattern = DailyRepeatPattern.new(user, @filterred_attributes)
|
||
|
|
end
|
||
|
|
|
||
|
|
def filter_attributes(attributes)
|
||
|
|
@filterred_attributes = filter_generic_attributes(attributes)
|
||
|
|
%w{daily_selector daily_every_x_days}.each{|key| @filterred_attributes[key] = attributes[key] if attributes.key?(key)}
|
||
|
|
@filterred_attributes
|
||
|
|
end
|
||
|
|
|
||
|
|
end
|
||
|
|
|
||
|
|
end
|