I'm currently working with some code that IMO has abused ruby's mixin features. Given that I'm new to ruby, I wonder if MO in IMO is correct or not.My primary question is what makes more sense (and if there are any major technical differences between them):E.g.1to create Helper singleton classes (or Modules with class methods) to keep all my helper functions.module Helper  def foo(); p 'foo'; end  # instance methodendclass User  include Helper     # foo() is now a method of User  def initialize()    foo()            # included, invoked on User class object  endend------- OR -------2create mixin modules that contain these functions and include them everywhere I need them.module Helper  def self.foo(); p 'foo'; end  # class methodendclass User  def initialize()    Helper.foo()            # Invoked on Helper module object  endendAn example of the way it's abused in my case:module ComplexMathPerformer  def perform_complex_math(); p 'perform_complex_math()'; endendmodule Renderer  def render_3d_object()    perform_complex_math() # from ComplexMathPerformer, which is NOT included here.  endendmodule Game  include ComplexMathPerformer  include Renderer  def play()    render_3d_object()  endendThis code works because Game includes both Renderer and ComplexMathPerformer. But is a nightmare for someone who's looking at ComplexMathPerformer and trying to figure out where the hell is is foo() defined and how is it accessible in ComplexMathPerformer.Logically it makes more sense to include ComplexMathPerformer but that's skipped because Game already includes ComplexMathPerformer (for it's own purposes). Making it a mess.
Ruby: Abusing mixin
refactoring;ruby;ruby on rails;code organization;mixins