Skip to content

Instantly share code, notes, and snippets.

@thiagovsk
Last active March 16, 2022 21:33
Show Gist options
  • Save thiagovsk/116f34c203046ec140247f2df293bef6 to your computer and use it in GitHub Desktop.
Save thiagovsk/116f34c203046ec140247f2df293bef6 to your computer and use it in GitHub Desktop.
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