Class: Rouge::Lexers::PlainText

Inherits:
Rouge::Lexer show all
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

Attributes inherited from Rouge::Lexer

#options

Instance Method Summary collapse

Methods inherited from Rouge::Lexer

aliases, all, #as_bool, #as_lexer, #as_list, #as_string, #as_token, #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

token

Constructor Details

#initializePlainText

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

#tokenObject (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

Yields:



22
23
24
# File 'lib/rouge/lexers/plain_text.rb', line 22

def stream_tokens(string, &b)
  yield self.token, string
end