class Kalendor::Factory

Public Instance Methods

annual(date, month) click to toggle source
# File lib/kalendor/factory.rb, line 17
def annual date, month
  Kalendor::Instance::Annual.new annual_month: month, annual_date: date
end
intersect(*schedules) click to toggle source
# File lib/kalendor/factory.rb, line 26
def intersect *schedules
  s = schedules.compact
  s.length == 1 ? s[0] : Kalendor::Instance::Intersect.new(schedules: s)
end
interval(from, upto) click to toggle source
# File lib/kalendor/factory.rb, line 39
def interval from, upto
  Kalendor::Instance::Interval.new interval_from: date(from), interval_upto: date(upto)
end
list(*dates) click to toggle source
# File lib/kalendor/factory.rb, line 35
def list *dates
  Kalendor::Instance::DateList.new dates: dates.map { |d| date d }
end
month(n) click to toggle source
# File lib/kalendor/factory.rb, line 47
def month n
  Kalendor::Instance::Month.new month: n
end
monthly(d) click to toggle source
# File lib/kalendor/factory.rb, line 51
def monthly d
  Kalendor::Instance::Monthly.new monthly_date: d
end
subtract(x, y) click to toggle source
# File lib/kalendor/factory.rb, line 31
def subtract x, y
  Kalendor::Instance::Subtract.new include_dates: x, exclude_dates: y
end
subtract?(x, y ;) click to toggle source
# File lib/kalendor/factory.rb, line 55
def subtract? x, y ; y ? subtract(x, y) : x ; end
union(*schedules) click to toggle source
# File lib/kalendor/factory.rb, line 21
def union *schedules
  s = schedules.compact
  s.length == 1 ? s[0] : Kalendor::Instance::Union.new(schedules: s)
end
weekday(weekday, nth_of_month=nil) click to toggle source
# File lib/kalendor/factory.rb, line 43
def weekday weekday, nth_of_month=nil
  Kalendor::Instance::Weekday.new weekday: weekday, nth_of_month: nth_of_month
end