lib/betagouvbot/sorting_hat.rb
# Input: a date
# Input: a list of members' arrivals and departures
# Side-effect: keeps current members subscribed to one list and alumni to another
a date
Input: a list of members' arrivals and departures
Side-effect: keeps current members subscribed to one list and alumni to another
a date Input : a list of members ' arrivals and departures Side - effect : keeps current members subscribed to one list and alumni to another
def subscribe_new(current, target, listname)
        arriving =
          target
          .map(&:with_indifferent_access)
          .select { |author| current.none? { |email| email == email(author) } }
        arriving.map { |incoming| subscribe(listname, email(incoming)) } +
          arriving.map { |incoming| notify(true, listname, incoming) }
      end
def subscribe_new ( current , target , listname ) arriving = target . map ( & :with_indifferent_access ) . select { | author | current . none? { | email | email == email ( author ) } } arriving . map { | incoming | subscribe ( listname , email ( incoming ) ) } + arriving . map { | incoming | notify ( true , listname , incoming ) } end
Input: a date
Input: a list of members' arrivals and departures
Side-effect: keeps current members subscribed to one list and alumni to another
Input : a date Input : a list of members ' arrivals and departures Side - effect : keeps current members subscribed to one list and alumni to another
current
target
listname