class CodeRay::Encoders::Count

Returns the number of tokens.

Text and block tokens are counted.

Public Instance Methods

begin_group(kind) click to toggle source
# File lib/coderay/encoders/count.rb, line 29
def begin_group kind
  @count += 1
end
Also aliased as: end_group, begin_line, end_line
begin_line(kind) click to toggle source
Alias for: begin_group
end_group(kind) click to toggle source
Alias for: begin_group
end_line(kind) click to toggle source
Alias for: begin_group
text_token(text, kind) click to toggle source
# File lib/coderay/encoders/count.rb, line 25
def text_token text, kind
  @count += 1
end

Protected Instance Methods

finish(options) click to toggle source
# File lib/coderay/encoders/count.rb, line 19
def finish options
  output @count
end
setup(options) click to toggle source
# File lib/coderay/encoders/count.rb, line 13
def setup options
  super
  
  @count = 0
end