Oxycon Blog
  • Home
  • About
  • Contact
  • Twitter
  • Instagram
  • OpenSource
  • Github
  • RSS
  • Home
  • About
  • Contact
  • Twitter
  • Instagram
  • OpenSource
  • Github
  • RSS
Extend, prepend and include in Ruby

Extend, prepend and include in Ruby

Extend, prepend, and include in Ruby each add module code to a class differently: prepend puts the module before the class so its methods win, extend adds class methods, include adds instance methods. Short runnable examples show how each changes the method lookup chain.

Aug 29, 2023

extend
Monkey patching in Ruby done right - refine method with prepend and include ruby

Monkey patching in Ruby done right - refine method with prepend and include

Monkey patching in Ruby without global damage: why reopening a class like DateTime directly backfires, how prepend and include change the ancestor chain safely, and how refine limits your patch to a single scope so the rest of the codebase stays untouched.

Jun 19, 2023

Latest

Page 1 of 1
Oxycon Blog

Thought stories and ideas to Oxygenate You, Your product and The World in practice.

Explore

  • Home
  • About
  • Contact
  • Twitter
  • Instagram
  • OpenSource
  • Github
  • RSS

© 2026 Oxycon Blog. All rights reserved.

We use cookies to improve our services.