Created
January 3, 2019 15:46
-
-
Save MaryKuz/db827f1d23ebd02fd4dc42a2a454ad55 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
class SMS | |
attr_reader :phone | |
def self.configure(texts:, **args) | |
const_set('TEXTS', texts) | |
end | |
def initialize(type:, phone:, **attrs) | |
@type = type | |
@phone = phone | |
@attrs = attrs | |
end | |
def to_s | |
TEXTS[@type] % @attrs | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment