21 lines
337 B
Ruby
21 lines
337 B
Ruby
module Tables
|
|
class Table < Array
|
|
attr_writer :discomfort
|
|
|
|
def initialize(*args)
|
|
super
|
|
reset
|
|
end
|
|
|
|
def reset
|
|
original_discomfort = @discomfort
|
|
@discomfort = nil
|
|
original_discomfort
|
|
end
|
|
|
|
def discomfort
|
|
@discomfort ||= DiscomfortCalculator.new(self).calculate
|
|
end
|
|
end
|
|
end
|