Method: CodeRay::TokensProxy#encode
- Defined in:
- lib/coderay/tokens_proxy.rb
#encode(encoder, options = {}) ⇒ Object
Call CodeRay.encode if encoder is a Symbol; otherwise, convert the receiver to tokens and call encoder.encode_tokens.
21 22 23 24 25 26 27 |
# File 'lib/coderay/tokens_proxy.rb', line 21 def encode encoder, = {} if encoder.respond_to? :to_sym CodeRay.encode(input, lang, encoder, ) else encoder.encode_tokens tokens, end end |