module MyMod
  def MyMod.append_features(someClass)
    def someClass.modmeth
      puts "Module (class) method"
    end
    super    # This call is necessary!
  end
  def meth1
    puts "Method 1"
  end
end

class MyClass
  include MyMod
  def MyClass.classmeth
    puts "Class method"
  end
  def meth2
    puts "Method 2"
  end
end

x = MyClass.new

                       # Output:
MyClass.classmeth      #   Class method
x.meth1                #   Method 1
MyClass.modmeth        #   Module (class) method
x.meth2                #   Method 2

