Class: Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/belvo/utils.rb

Overview

Class with helper functions

Class Method Summary collapse

Class Method Details

.read_file_to_b64(path) ⇒ Object



7
8
9
10
11
12
# File 'lib/belvo/utils.rb', line 7

def self.read_file_to_b64(path)
  return if path.nil? || !File.file?(path)

  data = File.open(path).read
  Base64.encode64(data)
end