Skip to content

Instantly share code, notes, and snippets.

@ohta-rh
Created May 5, 2012 06:43
Show Gist options
  • Select an option

  • Save ohta-rh/2600427 to your computer and use it in GitHub Desktop.

Select an option

Save ohta-rh/2600427 to your computer and use it in GitHub Desktop.
sample code
require 'digest/md5'
class Hoge
def initialize
@data = nil
end
def data=(data)
@data = Digest::MD5::hexdigest(data)
end
def data
"DIGEST:#{@data}"
end
end
hoge = Hoge.new
hoge.data = "hogehoge"
p hoge.data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment