Class: Attach::BlobTypes::Raw
- Inherits:
-
Object
- Object
- Attach::BlobTypes::Raw
- Defined in:
- lib/attach/blob_types/raw.rb
Instance Method Summary collapse
- #digest ⇒ Object
-
#initialize(data) ⇒ Raw
constructor
A new instance of Raw.
- #read ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(data) ⇒ Raw
Returns a new instance of Raw.
7 8 9 |
# File 'lib/attach/blob_types/raw.rb', line 7 def initialize(data) @data = data end |
Instance Method Details
#digest ⇒ Object
19 20 21 |
# File 'lib/attach/blob_types/raw.rb', line 19 def digest Digest::SHA1.hexdigest(@data) end |
#read ⇒ Object
11 12 13 |
# File 'lib/attach/blob_types/raw.rb', line 11 def read @data end |
#size ⇒ Object
15 16 17 |
# File 'lib/attach/blob_types/raw.rb', line 15 def size @data.bytesize end |