Class: CodeRay::Encoders::Count
- Defined in:
- lib/coderay/encoders/count.rb
Overview
Returns the number of tokens.
Text and block tokens are counted.
Constant Summary
Constants inherited from Encoder
Instance Attribute Summary
Attributes inherited from Encoder
Attributes included from Plugin
Instance Method Summary collapse
- #begin_group(kind) ⇒ Object (also: #end_group, #begin_line, #end_line)
- #text_token(text, kind) ⇒ Object
Methods inherited from Encoder
#<<, const_missing, #encode, #encode_tokens, file_extension, #file_extension, #initialize, #token
Methods included from Plugin
#aliases, #plugin_host, #register_for, #title
Constructor Details
This class inherits a constructor from CodeRay::Encoders::Encoder
Instance Method Details
#begin_group(kind) ⇒ Object Also known as: end_group, begin_line, end_line
29 30 31 |
# File 'lib/coderay/encoders/count.rb', line 29 def begin_group kind @count += 1 end |
#text_token(text, kind) ⇒ Object
25 26 27 |
# File 'lib/coderay/encoders/count.rb', line 25 def text_token text, kind @count += 1 end |