23 lines
387 B
Ruby

module Tables
class Table < Array
attr_writer :discomfort
attr_reader :id
def initialize(*args)
super
reset
@id = SecureRandom.uuid
end
def reset
original_discomfort = @discomfort
@discomfort = nil
original_discomfort
end
def discomfort
@discomfort ||= DiscomfortCalculator.new(self).calculate
end
end
end