class CommandParser def initialize(text) @text = text end # Takes text and turns it into a Ruby statement that can be passed to instance_eval # on the appropriate object. def parse quote_urls @text end # Put quotes around unquoted urls def quote_urls @text.gsub!(/([\s(])(http:[^\s)]*)/, '\1\'\2\'') end end