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, 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

token

Constructor Details

#initializePlainText

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

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

Yields:



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

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