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, debug_enabled?, demo, demo_file, desc, detect?, 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, mimetypes, option, option_docs, #reset!, #string_option, tag, #tag, title, #token_option
Methods included from Token::Tokens
Constructor Details
#initialize ⇒ PlainText
Returns a new instance of PlainText.
15 16 17 18 19 |
# File 'lib/rouge/lexers/plain_text.rb', line 15 def initialize(*) super @token = token_option(:token) || Text end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
14 15 16 |
# File 'lib/rouge/lexers/plain_text.rb', line 14 def token @token end |
Instance Method Details
#stream_tokens(string) {|self.token, string| ... } ⇒ Object
21 22 23 |
# File 'lib/rouge/lexers/plain_text.rb', line 21 def stream_tokens(string, &b) yield self.token, string end |