20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/app_report/decoder.rb', line 20
def self.decode encoded, encoding = 'base64'
supported = ['base64']
if encoded.blank?
raise AppReport::Errors::DecoderError, "Encoded can't be blank"
elsif encoding.blank?
raise AppReport::Errors::DecoderError, "Encoding can't be blank!"
elsif not supported.include? encoding
raise AppReport::Errors::DecoderError, "Encoding '#{encoding}' not supported, only #{supported}."
end
send "decode_#{encoding}", encoded
end
|