Sha256: b56b1d02f7d4e6a23bceb246dd3ddf061a0ad8f6a57a7c502f0b45ca9eccf448

Contents?: true

Size: 471 Bytes

Versions: 7

Compression:

Stored size: 471 Bytes

Contents

module Rollbar
  module Encoding
    def self.encode(object)
      can_be_encoded = object.is_a?(Symbol) || object.is_a?(String)

      return object unless can_be_encoded

      encoding_class.new(object).encode
    end

    def self.encoding_class
      if String.instance_methods.include?(:encode)
        require 'rollbar/encoding/encoder'
        Encoder
      else
        require 'rollbar/encoding/legacy_encoder'
        LegacyEncoder
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rollbar-2.2.0 lib/rollbar/encoding.rb
rollbar-2.1.2 lib/rollbar/encoding.rb
rollbar-2.1.1 lib/rollbar/encoding.rb
rollbar-2.1.0 lib/rollbar/encoding.rb
rollbar-2.0.2 lib/rollbar/encoding.rb
rollbar-2.0.1 lib/rollbar/encoding.rb
rollbar-2.0.0 lib/rollbar/encoding.rb