lib/betagouvbot/sorting_hat.rb
def unsubscribe_current(all, current, target, listname)
        leaving =
          current
          .select { |email| all.any? { |author| email == email(author) } }
          .select { |email| target.none? { |author| email == email(author) } }

        leaving.map { |outgoing| unsubscribe(listname, outgoing) } +
          leaving.map { |outgoing| notify(false, listname, author(all, outgoing)) }
      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
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 unsubscribe_current(all, current, target, listname)
        leaving =
          current
          .select { |email| all.any? { |author| email == email(author) } }
          .select { |email| target.none? { |author| email == email(author) } }
        leaving.map { |outgoing| unsubscribe(listname, outgoing) } +
          leaving.map { |outgoing| notify(false, listname, author(all, outgoing)) }
      end
def unsubscribe_current ( all , current , target , listname ) leaving = current . select { | email | all . any? { | author | email == email ( author ) } } . select { | email | target . none? { | author | email == email ( author ) } } leaving . map { | outgoing | unsubscribe ( listname , outgoing ) } + leaving . map { | outgoing | notify ( false , listname , author ( all , outgoing ) ) } 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
all
current
target
listname