Skip to content

Instantly share code, notes, and snippets.

@thisismydesign
Created August 21, 2018 12:44
Show Gist options
  • Save thisismydesign/6da17750450e93090c8e2996efcee155 to your computer and use it in GitHub Desktop.
Save thisismydesign/6da17750450e93090c8e2996efcee155 to your computer and use it in GitHub Desktop.
Ruby: how to use self.included meaningfully, solution
module CreateClassMethodsUponInclude
def self.included(base)
# does what we want
end
end
module MyModule
include CreateClassMethodsUponInclude
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment