lib/mangopay/util/file_encoder.rb in mangopay-v4-4.0.0 vs lib/mangopay/util/file_encoder.rb in mangopay-v4-4.0.1
- old
+ new
@@ -1,16 +1,16 @@
-require 'base64'
-
-# Encodes files
-module FileEncoder
- class << self
-
- # 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
- def encode_base64(path)
- data = File.open(path, 'rb', &:read)
- Base64.strict_encode64 data
- end
- end
+require 'base64'
+
+# Encodes files
+module FileEncoder
+ class << self
+
+ # 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
+ def encode_base64(path)
+ data = File.open(path, 'rb', &:read)
+ Base64.strict_encode64 data
+ end
+ end
end
\ No newline at end of file