module FileEncoder

Encodes files

Public Class Methods

encode_base64(path) click to toggle source

Encodes a file to a Base64 string.

@param path [String] path to the file to be encoded @return [String] the file as a Base64-encoded string

# File lib/mangopay/util/file_encoder.rb, line 11
def encode_base64(path)
  data = File.open(path, 'rb', &:read)
  Base64.strict_encode64 data
end