Last active
March 16, 2022 21:30
-
-
Save thiagovsk/90314510bb46923b78a2429b54d81d57 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 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