Should mixins make assumptions about their including class?
问题 I found examples of a mixin that makes assumptions about what instance variables an including class has. Something like this: module Fooable def calculate @val_one + @val_two end end class Bar attr_accessor :val_one, :val_two include Fooable end I found arguments for and against whether it's a good practice. The obvious alternative is passing val_one and val_two as parameters, but that doesn't seem as common, and having more heavily parameterized methods could be a downside. Is there