Skip to content

Commit 23981c5

Browse files
authored
Add an example for Module#define_method (#7)
1 parent 92e7434 commit 23981c5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ ruby2_keywords def oldstyle_keywords(options = {})
4242
end
4343
```
4444

45+
You can do the same for a method defined by `Module#define_method`:
46+
47+
```ruby
48+
define_method :delegating_method do |*args, &block|
49+
other_method(*args, &block)
50+
end
51+
ruby2_keywords :delegating_method
52+
```
53+
4554
## Contributing
4655

4756
Bug reports and pull requests are welcome on GitHub at https://bugs.ruby-lang.org.

0 commit comments

Comments
 (0)