lib/by_star/by_fortnight.rb
# For reasoning why I use *args rather than variables here,
# please see the by_year method comments in lib/by_star/by_year.rb
For reasoning why I use *args rather than variables here,
please see the by_year method comments in lib/by_star/by_year.rb
For reasoning why I use * args rather than variables here please see the by_year method comments in lib / by_star / by_year . rb
def by_fortnight_String_or_Fixnum(weeks, options={})
      weeks = weeks.to_i
      current_time = Time.zone.local(options[:year] || Time.zone.now.year)
      if weeks <= 26
        start_time = current_time + (weeks * 2).weeks
        between(start_time, (start_time + 2.weeks).end_of_day, options)
      else
        raise ParseError, "by_fortnight takes only a Time, Date or a Fixnum (less than or equal to 26)."
      end
    end
def by_fortnight_String_or_Fixnum ( weeks , options = { } ) weeks = weeks . to_i current_time = Time . zone . local ( options [ :year ] || Time . zone . now . year ) if weeks <= 26 start_time = current_time + ( weeks * 2 ) . weeks between ( start_time , ( start_time + 2 . weeks ) . end_of_day , options ) else raise ParseError , "by_fortnight takes only a Time, Date or a Fixnum (less than or equal to 26)." end end
For reasoning why I use *args rather than variables here,
please see the by_year method comments in lib/by_star/by_year.rb
For reasoning why I use * args rather than variables here please see the by_year method comments in lib / by_star / by_year . rb
weeks
<not_specific>
options
<not_specific>