Skip to content

Instantly share code, notes, and snippets.

@arnvald
Created May 18, 2015 16:00
Show Gist options
  • Save arnvald/03d184fcf1a8406539bb to your computer and use it in GitHub Desktop.
Save arnvald/03d184fcf1a8406539bb to your computer and use it in GitHub Desktop.
module ShowMyMethods
def self.included(base)
puts (base.instance_methods - Object.instance_methods).sort
end
end
class IncludeFirst
include ShowMyMethods
def it_wont_be_shown; end
end
class IncludeLast
def it_will_be_shown; end
include ShowMyMethods
end
# λ ARV ruby → ruby including.rb
# it_will_be_shown
# λ ARV ruby →
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment