Module: Rollbar::Encoding

Defined in:
lib/rollbar/encoding.rb,
lib/rollbar/encoding/encoder.rb

Defined Under Namespace

Classes: Encoder

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.encoding_classObject

Returns the value of attribute encoding_class.



4
5
6
# File 'lib/rollbar/encoding.rb', line 4

def encoding_class
  @encoding_class
end

Class Method Details

.encode(object) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/rollbar/encoding.rb', line 12

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

  return object unless can_be_encoded

  encoding_class.new(object).encode
end

.setupObject



7
8
9
10
# File 'lib/rollbar/encoding.rb', line 7

def self.setup
  require 'rollbar/encoding/encoder'
  self.encoding_class = Rollbar::Encoding::Encoder
end