Class: Rouge::Lexers::PlainText
- Inherits:
-
Rouge::Lexer
- Object
- Rouge::Lexer
- Rouge::Lexers::PlainText
- Defined in:
- lib/rouge/lexers/plain_text.rb
Constant Summary
Constants included from Token::Tokens
Token::Tokens::Num, Token::Tokens::Str
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from Rouge::Lexer
Instance Method Summary collapse
-
#initialize ⇒ PlainText
constructor
A new instance of PlainText.
- #stream_tokens(string) {|self.token, string| ... } ⇒ Object
Methods inherited from Rouge::Lexer
aliases, all, #as_bool, #as_lexer, #as_list, #as_string, #as_token, assert_utf8!, #bool_option, #continue_lex, continue_lex, debug_enabled?, demo, demo_file, desc, detect?, detectable?, disable_debug!, enable_debug!, filenames, find, find_fancy, guess, guess_by_filename, guess_by_mimetype, guess_by_source, guesses, #hash_option, lex, #lex, #lexer_option, #list_option, lookup_fancy, mimetypes, option, option_docs, #reset!, #string_option, tag, #tag, title, #token_option, #with
Methods included from Token::Tokens
Constructor Details
#initialize ⇒ PlainText
Returns a new instance of PlainText.
16 17 18 19 20 |
# File 'lib/rouge/lexers/plain_text.rb', line 16 def initialize(*) super @token = token_option(:token) || Text end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
15 16 17 |
# File 'lib/rouge/lexers/plain_text.rb', line 15 def token @token end |
Instance Method Details
#stream_tokens(string) {|self.token, string| ... } ⇒ Object
22 23 24 |
# File 'lib/rouge/lexers/plain_text.rb', line 22 def stream_tokens(string, &b) yield self.token, string end |