Class: XmlUtils::Tokenizer
- Inherits:
-
Object
- Object
- XmlUtils::Tokenizer
- Defined in:
- lib/xmlutils/tokenizer.rb
Constant Summary collapse
- XML_NAME_PATTERN =
/[A-Za-z_][A-Za-z0-9_.:-]*/.freeze
Instance Method Summary collapse
-
#initialize(source) ⇒ Tokenizer
constructor
A new instance of Tokenizer.
- #tokenize ⇒ Object
Constructor Details
#initialize(source) ⇒ Tokenizer
Returns a new instance of Tokenizer.
44 45 46 47 48 49 50 |
# File 'lib/xmlutils/tokenizer.rb', line 44 def initialize(source) @source = source.respond_to?(:read) ? source.read : source.to_s @pos = 0 @line = 1 @col = 1 @tokens = [] end |