Skip to content

Instantly share code, notes, and snippets.

@JamesAndresCM
Created December 1, 2021 22:48
Show Gist options
  • Save JamesAndresCM/7eb894aa4d0b62ae014bf74fe675fc51 to your computer and use it in GitHub Desktop.
Save JamesAndresCM/7eb894aa4d0b62ae014bf74fe675fc51 to your computer and use it in GitHub Desktop.
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