module Greeter def hi "hello" end end # A silly module s = "string object" s.extend(Greeter) # Add hi as a singleton method to s s.hi # => "hello" String.extend(Greeter) # Add hi as a class method of String String.hi # => "hello"