Module: MixpanelTyphoeus::Support

Defined in:
lib/mixpanel_typhoeus/support.rb

Overview

Grabbed these ActiveSupport functions from ActiveSupport::Base64. Reduces dependency on ActiveSupport.

Class Method Summary collapse

Class Method Details

.decode64(data) ⇒ Object



10
11
12
# File 'lib/mixpanel_typhoeus/support.rb', line 10

def decode64(data)
  data.unpack("m").first
end

.encode64(data) ⇒ Object



5
6
7
# File 'lib/mixpanel_typhoeus/support.rb', line 5

def encode64(data)
  [data].pack('m')
end

.encode64s(value) ⇒ Object



15
16
17
# File 'lib/mixpanel_typhoeus/support.rb', line 15

def encode64s(value)
  encode64(value).gsub(/\n/, '')
end