Last active
October 28, 2022 10:06
-
-
Save olly/de361beeb9753988c44cf5e4dc44b6ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WhatAmIMissing | |
module Cat | |
module Bill | |
def thing | |
[1,2,3] | |
end | |
end | |
end | |
class John | |
include Cat::Bill | |
def thing | |
# ALSO: `concat` rather than `concat!` | |
super.concat([5,5]) | |
end | |
end | |
end | |
WhatAmIMissing::John.new.thing | |
=> [1, 2, 3, 5, 5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment