Skip to content

Instantly share code, notes, and snippets.

@bvsatyaram
Created December 20, 2011 05:24
Show Gist options
  • Save bvsatyaram/1500386 to your computer and use it in GitHub Desktop.
Save bvsatyaram/1500386 to your computer and use it in GitHub Desktop.
Data Encoder to save marshal dump data to database
module EvitcaDataEncoder
require "base64"
class << self
def encode(data)
Base64.encode64(Marshal.dump(data))
end
def decode(string)
Marshal.load(Base64.decode64(string))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment