class Basefile::FileHandler

Attributes

filein[RW]
fileout[RW]

Public Instance Methods

decode_file(encoded_str) click to toggle source
# File lib/basefile/file_handler.rb, line 19
def decode_file(encoded_str)
  if @fileout == nil
    return false
  else
    File.open(@fileout, "wb") do |file|
      file.write(::Basefile::Base64Shim.decode(encoded_str))
    end
  end
end
encode_file() click to toggle source
# File lib/basefile/file_handler.rb, line 10
def encode_file
  if @filein == nil
    return false
  else
    f = File.open(@filein)
    return ::Basefile::Base64Shim.encode(f.read)
  end
end
initalize(filein, fileout) click to toggle source
# File lib/basefile/file_handler.rb, line 5
def initalize(filein, fileout)
  @filein = filein || nil
  @fileout = fileout || nil
end