# Simple example for plugin to change files?

**URL:** <https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206>\
**Category:** Development\
**Created:** [June 30, 2023, 9:40pm UTC](https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206 "2023-06-30T21:40:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [June 30, 2023, 9:52pm UTC](https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206/2 "2023-06-30T21:52:30Z")

</div>

This is a technique known as “monkey patching”. There are several ways to accomplish this but the easiest is to just define the method you want to replace in your plugin.

```rb
after_initialize do
  class ::TopicEmbed
    def self.imported_from_html(url)
       # your code
    end
  end
end

```

---

_[View the full topic](https://meta.discourse.org/t/simple-example-for-plugin-to-change-files/270206)._
