Is there some reason you can't more directly:

module FooInternals
    case RUBY_PLATFORM
       when /win/i
          def bar
             "Windows"
          end
       when /bsd/i
          def bar
             "BSD"
          end
       when /mac/i
          def bar
             "Macintosh"
          end
    end
end

class Foo
    include FooInternals
end