Method: CodeRay::Encoders::Encoder#initialize
- Defined in:
- lib/coderay/encoder.rb
#initialize(options = {}) ⇒ Encoder
Creates a new Encoder. options is saved and used for all encode operations, as long as you don’t overwrite it there by passing additional options.
Encoder objects provide three encode methods:
-
encode simply takes a
codestring and alang -
encode_tokens expects a
tokensobject instead
Each method has an optional options parameter. These are added to the options you passed at creation.
66 67 68 69 |
# File 'lib/coderay/encoder.rb', line 66 def initialize = {} = self.class::DEFAULT_OPTIONS.merge @@CODERAY_TOKEN_INTERFACE_DEPRECATION_WARNING_GIVEN = false end |