Module: FileEncoder
- Defined in:
- lib/mangopay/util/file_encoder.rb
Overview
Encodes files
Class Method Summary collapse
-
.encode_base64(path) ⇒ String
Encodes a file to a Base64 string.
Class Method Details
.encode_base64(path) ⇒ String
Encodes a file to a Base64 string.
11 12 13 14 |
# File 'lib/mangopay/util/file_encoder.rb', line 11 def encode_base64(path) data = File.open(path, 'rb', &:read) Base64.strict_encode64 data end |