summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/null.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/encoders/null.rb')
-rw-r--r--lib/coderay/encoders/null.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/coderay/encoders/null.rb b/lib/coderay/encoders/null.rb
index 67c4987..e995cb0 100644
--- a/lib/coderay/encoders/null.rb
+++ b/lib/coderay/encoders/null.rb
@@ -1,12 +1,20 @@
module CodeRay
module Encoders
+ # = Null Encoder
+ #
+ # Does nothing and returns an empty string.
class Null < Encoder
include Streamable
register_for :null
- protected
+ # Defined for faster processing
+ def to_proc
+ proc {}
+ end
+
+ protected
def token(*)
# do nothing
@@ -16,5 +24,3 @@ module CodeRay
end
end
-
-