Class CodeRay::Encoders::Count
In: lib/coderay/encoders/count.rb
Parent: Encoder

Returns the number of tokens.

Text and block tokens are counted.

Methods

Public Instance methods

[Source]

    # File lib/coderay/encoders/count.rb, line 29
29:     def begin_group kind
30:       @count += 1
31:     end
begin_line(kind)

Alias for begin_group

end_group(kind)

Alias for begin_group

end_line(kind)

Alias for begin_group

[Source]

    # File lib/coderay/encoders/count.rb, line 25
25:     def text_token text, kind
26:       @count += 1
27:     end

Protected Instance methods

[Source]

    # File lib/coderay/encoders/count.rb, line 19
19:     def finish options
20:       output @count
21:     end

[Source]

    # File lib/coderay/encoders/count.rb, line 13
13:     def setup options
14:       super
15:       
16:       @count = 0
17:     end

[Validate]