Skip to content

Instantly share code, notes, and snippets.

@thoraxe
Created March 25, 2014 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoraxe/9752673 to your computer and use it in GitHub Desktop.
Save thoraxe/9752673 to your computer and use it in GitHub Desktop.
class CryptoFile
attr_accessor :file_contents, :retrieve_key
attr_reader :id
def initialize(params={})
params.each do |attr, value|
self.public_send("#{attr}=", value)
end if params
if @id == nil
@id = SecureRandom.uuid
end
end
def id=(value)
if value == nil
@id = SecureRandom.uuid
else
@id = value
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment