Class: StableMatching::Roommate::PreferenceTable

Inherits:
PreferenceTable
  • Object
show all
Defined in:
lib/stable-matching/roommate/preference_table.rb

Instance Attribute Summary

Attributes inherited from PreferenceTable

#name_to_member_mapping

Instance Method Summary collapse

Methods inherited from PreferenceTable

#complete?, #initialize, #members, #print, #to_s, #unmatched

Constructor Details

This class inherits a constructor from StableMatching::PreferenceTable

Instance Method Details

#members_with_multiple_preferencesObject



15
16
17
# File 'lib/stable-matching/roommate/preference_table.rb', line 15

def members_with_multiple_preferences
  members.select { |member| member.preference_list.count > 1 }
end

#stable?Boolean



11
12
13
# File 'lib/stable-matching/roommate/preference_table.rb', line 11

def stable?
  members.all? { |member| !member.preference_list.empty? }
end