Class: ActiveStorageAttachedOneDrop

Inherits:
Liquidum::Drop show all
Defined in:
lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb

Instance Method Summary collapse

Methods inherited from Liquidum::Drop

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_typeObject



12
13
14
# File 'lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb', line 12

def content_type
  @object.content_type
end

#downloadObject



4
5
6
# File 'lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb', line 4

def download
  @object.download
end

#filenameObject



8
9
10
# File 'lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb', line 8

def filename
  @object.filename.to_s
end

#to_ioObject



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