Class: Jeff::Content
- Inherits:
-
Object
- Object
- Jeff::Content
- Defined in:
- lib/jeff.rb
Overview
Calculates an MD5sum for file being uploaded.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(body) ⇒ Content
constructor
A new instance of Content.
- #md5 ⇒ Object
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
#body ⇒ Object (readonly)
Returns the value of attribute body.
31 32 33 |
# File 'lib/jeff.rb', line 31 def body @body end |
Instance Method Details
#md5 ⇒ Object
37 38 39 |
# File 'lib/jeff.rb', line 37 def md5 Base64.encode64(OpenSSL::Digest::MD5.digest(body)).strip end |