Permalink
Browse files

Fix some constants

  • Loading branch information...
1 parent f9a475b commit 45c2a76af6e015053090fdb72f21c1b6fb8f4785 John Crepezzi committed Apr 2, 2010
@@ -139,13 +139,13 @@ def to_ical_base
#put days on the string, remove all occurrences in days from days_of_week
if days_dedup
@validations[:day_of_week].keys.each { |day| days_dedup.delete(day) } if @validations[:day_of_week]
- representation << (days_dedup.map { |d| ICAL_DAYS[d]} ).join(',')
+ representation << (days_dedup.map { |d| IceCube::ICAL_DAYS[d]} ).join(',')
end
representation << ',' if days_dedup && @validations[:day_of_week]
#put days_of_week on string representation
representation << @validations[:day_of_week].inject([]) do |day_rules, pair|
day, occ = *pair
- day_rules.concat(occ.map {|v| v.to_s + ICAL_DAYS[day]})
+ day_rules.concat(occ.map {|v| v.to_s + IceCube::ICAL_DAYS[day]})
end.flatten.join(',') if @validations[:day_of_week]
end
representation << ';BYHOUR=' << @validations[:hour_of_day].join(',') if @validations[:hour_of_day]
@@ -10,8 +10,8 @@ def self.included(base)
def day(*days)
@validations[:day] ||= []
days.each do |day|
- raise ArgumentError.new('Argument must be a valid day of the week') unless DAYS.has_key?(day)
- @validations[:day] << DAYS[day]
+ raise ArgumentError.new('Argument must be a valid day of the week') unless IceCube::DAYS.has_key?(day)
+ @validations[:day] << IceCube::DAYS[day]
end
self
end
@@ -10,9 +10,9 @@ def self.included(base)
def day_of_week(days)
@validations[:day_of_week] ||= {}
days.each do |day, occurrences|
- raise ArgumentError.new('Argument must be a valid day') unless DAYS.has_key?(day)
- @validations[:day_of_week][DAYS[day]] ||= []
- @validations[:day_of_week][DAYS[day]].concat(occurrences)
+ raise ArgumentError.new('Argument must be a valid day') unless IceCube::DAYS.has_key?(day)
+ @validations[:day_of_week][IceCube::DAYS[day]] ||= []
+ @validations[:day_of_week][IceCube::DAYS[day]].concat(occurrences)
end
self
end
@@ -11,8 +11,8 @@ def self.included(base)
def month_of_year(*months)
@validations[:month_of_year] ||= []
months.each do |month|
- raise ArgumentError.new('Argument must be a valid month') unless MONTHS.has_key?(month)
- @validations[:month_of_year] << MONTHS[month]
+ raise ArgumentError.new('Argument must be a valid month') unless IceCube::MONTHS.has_key?(month)
+ @validations[:month_of_year] << IceCube::MONTHS[month]
end
self
end

0 comments on commit 45c2a76

Please sign in to comment.