Class: ActiveStorageAttachedOneDrop
Instance Method Summary
collapse
association, #initialize, #is_for_a?, #to_gid, #to_h, #to_sgid
Constructor Details
This class inherits a constructor from Liquidum::Drop
Instance Method Details
#content_type ⇒ Object
12
13
14
|
# File 'lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb', line 12
def content_type
@object.content_type
end
|
#download ⇒ Object
4
5
6
|
# File 'lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb', line 4
def download
@object.download
end
|
#filename ⇒ Object
8
9
10
|
# File 'lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb', line 8
def filename
@object.filename.to_s
end
|
#to_io ⇒ Object
16
17
18
19
20
|
# File 'lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb', line 16
def to_io
return unless @object.attached?
StringIO.new(@object.download)
end
|