Skip to content

Instantly share code, notes, and snippets.

@thiagovsk
Last active March 16, 2022 21:30
Embed
What would you like to do?
module Formatter
def self.included base
base.extend ClassMethods
end
module ClassMethods
def class_method
"yahy"
end
end
def formatted_phone
phone.delete("^0-9")
end
end
class Payment
include Formatter
def phone(phone)
formatted_phone(phone)
end
end
class Contact
include Formatter
def phone(phone)
formatted_phone(phone)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment