Skip to content

Instantly share code, notes, and snippets.

@olly
Last active October 28, 2022 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olly/de361beeb9753988c44cf5e4dc44b6ca to your computer and use it in GitHub Desktop.
Save olly/de361beeb9753988c44cf5e4dc44b6ca to your computer and use it in GitHub Desktop.
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