From 8f8d029f1e9ba286e43cedc274a89bae3fb318b4 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 30 Mar 2010 01:13:11 +0000 Subject: Added documentation to encoders; more code cleanups. --- lib/coderay/encoders/count.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/coderay/encoders/count.rb') 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 -- cgit v1.2.1