rb/lib/twitter-text/validation.rb
# DEPRECATED: Please use parse_text instead.
#
# Check the <tt>text</tt> for any reason that it may not be valid as a Tweet. This is meant as a pre-validation
# before posting to api.twitter.com. There are several server-side reasons for Tweets to fail but this pre-validation
# will allow quicker feedback.
#
# Returns <tt>false</tt> if this <tt>text</tt> is valid. Otherwise one of the following Symbols will be returned:
#
#   <tt>:too_long</tt>:: if the <tt>text</tt> is too long
#   <tt>:empty</tt>:: if the <tt>text</tt> is nil or empty
#   <tt>:invalid_characters</tt>:: if the <tt>text</tt> contains non-Unicode or any of the disallowed Unicode characters
Please use parse_text instead.
Check the text for any reason that it may not be valid as a Tweet. This is meant as a pre-validation
before posting to api.twitter.com. There are several server-side reasons for Tweets to fail but this pre-validation
will allow quicker feedback.

Returns false if this text is valid. Otherwise one of the following Symbols will be returned.


Please use parse_text instead . Check the text for any reason that it may not be valid as a Tweet . This is meant as a pre - validation before posting to api . twitter . com . There are several server - side reasons for Tweets to fail but this pre - validation will allow quicker feedback . Returns false if this text is valid . Otherwise one of the following Symbols will be returned .
def tweet_invalid?(text)
        return :empty if !text || text.empty?
        begin
          return :too_long if tweet_length(text) > MAX_LENGTH_LEGACY
          return :invalid_characters if Twitter::TwitterText::Regex::INVALID_CHARACTERS.any?{|invalid_char| text.include?(invalid_char) }
        rescue ArgumentError
          return :invalid_characters
        end
        return false
      end
def tweet_invalid? ( text ) return :empty if ! text || text . empty? begin return :too_long if tweet_length ( text ) > MAX_LENGTH_LEGACY return :invalid_characters if Twitter :: TwitterText :: Regex :: INVALID_CHARACTERS . any? { | invalid_char | text . include? ( invalid_char ) } rescue ArgumentError return :invalid_characters end return false end
DEPRECATED: Please use parse_text instead.
DEPRECATED : Please use parse_text instead .
# non-Unicode value.
text
<not_specific>