Class: Jeff::Content

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

Overview

Calculates an MD5sum for file being uploaded.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Content

Returns a new instance of Content.



33
34
35
# File 'lib/jeff.rb', line 33

def initialize(body)
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



31
32
33
# File 'lib/jeff.rb', line 31

def body
  @body
end

Instance Method Details

#md5Object



37
38
39
# File 'lib/jeff.rb', line 37

def md5
  Base64.encode64(OpenSSL::Digest::MD5.digest(body)).strip
end