/*global Autolinker */
* @class Autolinker.match.Twitter
* @extends Autolinker.match.Match
*
* Represents a Twitter match found in an input string which should be Autolinked.
*
* See this class's superclass ({@link Autolinker.match.Match}) for more details.
*/
Autolinker.match.Twitter = Autolinker.Util.extend( Autolinker.match.Match, {
/**
* @cfg {String} twitterHandle (required)
*
* The Twitter handle that was matched.
*/
* Returns the type of match that this class represents.
*
* @return {String}
*/
getType : function() {
return 'twitter';
},
/**
* Returns a string name for the type of match that this class represents.
*
* @return {String}
*/
getTwitterHandle : function() {
return this.twitterHandle;
},
* Returns the anchor href that should be generated for the match.
*
* @return {String}
*/
getAnchorHref : function() {
return 'https://twitter.com/' + this.twitterHandle;
},
* Returns the anchor text that should be generated for the match.
*
* @return {String}
*/
getAnchorText : function() {
return '@' + this.twitterHandle;
}
} );