Created
January 3, 2019 17:49
-
-
Save kohigh/e84230eb9f9156b069a2d3143c9d6a64 to your computer and use it in GitHub Desktop.
class for SMS objects
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