Skip to content

Instantly share code, notes, and snippets.

@troyleach
Created January 12, 2015 05:26
Show Gist options
  • Select an option

  • Save troyleach/c3a295991f9fa9d3d9cc to your computer and use it in GitHub Desktop.

Select an option

Save troyleach/c3a295991f9fa9d3d9cc to your computer and use it in GitHub Desktop.
Leap_year, the runner file
require_relative 'leap_year'
class Display
def single_year
puts "Sometimes it would be nice to know if a particular year was a leap year"
print "What year would you like to know if it was OR will be a leap year?: "
input = gets.chomp
answer = SingleLeapYear.new(input)
answer.leap_year?
answer.display
end
def get_input
puts "Want to know leap years in between given dates?"
puts "Enter a starting date and a ending date"
print "Starting year: "
starting_year = gets.chomp.to_i
print "Ending year: "
ending_year = gets.chomp.to_i
years = starting_year..ending_year
guess = LeapYearRange.new(years)
guess.leap_year?
guess.to_s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment