Created
December 1, 2021 22:48
-
-
Save JamesAndresCM/7eb894aa4d0b62ae014bf74fe675fc51 to your computer and use it in GitHub Desktop.
This file contains 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 Utilities | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
def method_one | |
puts 'Hello from an instance method' | |
end | |
module ClassMethods | |
def method_two | |
puts 'Hello from a class method' | |
end | |
end | |
end | |
class Example | |
include Utilities | |
end | |
Example.new.method_one | |
Example.method_two |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment