Skip to content

Instantly share code, notes, and snippets.

@thiagovsk
Last active Mar 16, 2022
Embed
What would you like to do?
using inheritance
class Formatter
def formatted_phone(phone)
phone.delete("^0-9")
end
end
class Payment < Formatter
def phone(phone)
formatted_phone(phone)
end
end
class Contact < 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