Skip to content

Instantly share code, notes, and snippets.

@watson
Created March 22, 2010 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watson/340384 to your computer and use it in GitHub Desktop.
Save watson/340384 to your computer and use it in GitHub Desktop.
module MessageType
MMS = "mms"
SMS = "sms"
end
class MessageType
VALID_TYPES = [:sms, :mms]
class << self
def method_missing(method, *args, &block)
if VALID_TYPES.include?(method.to_sym)
method.to_s
else
super
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment