lib/kalendar.rb
# End date of term with specified period
# @param num [Integer] period duration
# @param type [Symbol/String] period type :work_days, :calendar_days,
#   :weeks, :months, :quarters, :years
# @return [Date]
End date of term with specified period
End date of term with specified period
def end_of_term(num, type)
    raise ArgumentError, 'num cannot be negative or 0' if num <= 0
    unless PERIODS.include?(type.to_s)
      raise ArgumentError, "unknown period #{type}" 
    end
    send("after_#{type}", num)
  end
def end_of_term ( num , type ) raise ArgumentError , 'num cannot be negative or 0' if num <= 0 unless PERIODS . include? ( type . to_s ) raise ArgumentError , "unknown period #{type}" end send ( "after_#{type}" , num ) end
End date of term with specified period
End date of term with specified period
None
Date
num
None
type
period type :work_days, :calendar_days, :weeks, :months, :quarters, :years
period type : work_days : calendar_days : weeks : months : quarters : years