using CoreExt::RefinementBuilder build_refinement "Util" do def a 1 end def b a end end # The above definitiomn enables all the following usages: # 1. Use the methods as a refinement # By default they are patched onto Object but this can be changed # by supplying a refines: option to build_refinement. class Foo using Util puts b # => 1 puts a => 1 end # 2. Use the methods statically puts Util.a # => 1 puts Util.b # => 2 # 3. Use as a typical module via include include Util puts b # => 1 puts a # => 1