Class: ActiveStorageValidations::ASVAttachableAdapter::Blob
- Inherits:
-
Base
- Object
- Base
- ActiveStorageValidations::ASVAttachableAdapter::Blob
show all
- Defined in:
- lib/active_storage_validations/asv_attachable_adapter.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #rewind
Instance Method Details
#content_type ⇒ Object
105
106
107
|
# File 'lib/active_storage_validations/asv_attachable_adapter.rb', line 105
def content_type
@attachable.content_type
end
|
#filename ⇒ Object
109
110
111
|
# File 'lib/active_storage_validations/asv_attachable_adapter.rb', line 109
def filename
@attachable.filename
end
|
#read(max_byte_size: nil) ⇒ Object
113
114
115
|
# File 'lib/active_storage_validations/asv_attachable_adapter.rb', line 113
def read(max_byte_size: nil)
max_byte_size ? @attachable.download_chunk(0...max_byte_size) : @attachable.download
end
|
117
118
119
|
# File 'lib/active_storage_validations/asv_attachable_adapter.rb', line 117
def with_media_path(tempfile, &block)
copy_to_tempfile(tempfile, @attachable, &block)
end
|