fork download
  1. module Foo
  2. def a; :a; end
  3. end
  4.  
  5. class Bar; include Foo; end
  6. p Bar.new.a
  7.  
  8. class Baz; extend Foo; end
  9. Baz.extend(Foo)
  10. p Baz.a
  11.  
  12. b = "string"
  13. b.extend(Foo)
  14. p b.a
  15.  
  16. extend Foo
  17. p a
Success #stdin #stdout 0.01s 7412KB
stdin
Standard input is empty
stdout
:a
:a
:a
:a