wedding-planner/app/services/tables/discomfort_calculator.rb

23 lines
352 B
Ruby
Raw Normal View History

2024-07-31 22:53:19 +02:00
module Tables
class DiscomfortCalculator
private attr_reader :table
def initialize(table)
@table = table
end
def calculate
group_merging
end
private
def group_merging
10 * (number_of_groups - 1)
end
def number_of_groups
table.map(&:affinity_groups).flatten.uniq.count
end
end
end