root/vendor/coderay-0.7.4/lib/coderay/encoders/count.rb

Download in other formats: Raw | Text
Revisions
Dimitrij Denissenko
Dimitrij Denissenko
Jan 24 2009 * 11:51
(over 1 year ago)

Revision 94b95d21c5f6648aab2b27a9464ed8d65a035b28

Initial public import

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module CodeRay
module Encoders

  class Count < Encoder

    include Streamable
    register_for :count

    protected

    def setup options
      @out = 0
    end

    def token text, kind
      @out += 1
    end
  end

end
end