diff options
author | murphy <murphy@rubychan.de> | 2010-03-30 01:13:11 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2010-03-30 01:13:11 +0000 |
commit | 8f8d029f1e9ba286e43cedc274a89bae3fb318b4 (patch) | |
tree | 56e32bd33788c37f20a4d2f3bd51e58ad4c45022 /lib/coderay/encoders/count.rb | |
parent | 476bc1bfe2f2000acc665f034e7da19bd3f0cc6b (diff) | |
download | coderay-8f8d029f1e9ba286e43cedc274a89bae3fb318b4.tar.gz |
Added documentation to encoders; more code cleanups.
Diffstat (limited to 'lib/coderay/encoders/count.rb')
-rw-r--r-- | lib/coderay/encoders/count.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/coderay/encoders/count.rb b/lib/coderay/encoders/count.rb index c9a6dfd..2e60a89 100644 --- a/lib/coderay/encoders/count.rb +++ b/lib/coderay/encoders/count.rb @@ -1,12 +1,15 @@ module CodeRay module Encoders - + + # Returns the number of tokens. + # + # Text and block tokens (:open etc.) are counted. class Count < Encoder include Streamable register_for :count - protected + protected def setup options @out = 0 @@ -15,6 +18,7 @@ module Encoders def token text, kind @out += 1 end + end end |