Skip to content

Instantly share code, notes, and snippets.

@dpickett
Forked from mskyle/officiant.rb
Last active March 20, 2017 20:36
Show Gist options
  • Save dpickett/f20e87229a60be2b26a25efd457beb3a to your computer and use it in GitHub Desktop.
Save dpickett/f20e87229a60be2b26a25efd457beb3a to your computer and use it in GitHub Desktop.
require 'date'
class Officiant
def authorized?
is_minister_of_the_gospel? || willing_to_get_ordained_online?
end
def available?(date)
!not_really_interested && !busy?(date) && !generally_too_busy
end
def willing_to_officiate_wedding?(groom, bride, date, location)
return !busy?(date) && !too_far?(location) && think_should_get_married?(groom, bride) &&
authorized? && available?(date)
end
end
dan_pickett = Officiant.new
location = "Portland, Maine"
date = Date.new(2017, 11, 4) # it's a Saturday, ceremony probably around 4PM
dan_pickett.willing_to_officiate_wedding?(zach, kyle, date, location) # => true
dan_pickett.beyond_humbled_and_honored? # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment