Sha256: a28957888946106f70be240b316be75b75aa6f0eb11b0a976eeb25febd2885ec
Contents?: true
Size: 557 Bytes
Versions: 1
Compression:
Stored size: 557 Bytes
Contents
class Brut::FrontEnd::Download attr_reader :data def initialize(filename:,data:,content_type:,timestamp: false) @filename = filename @data = data @content_type = content_type @timestamp = timestamp end def headers filename = if @timestamp Time.now.strftime("%Y-%m-%dT%H-%M-%S") + "-" + @filename else @filename end { "content-disposition" => "attachment; filename=\"#{filename}\"", "content-type" => @content_type, } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
brut-0.0.1 | lib/brut/front_end/download.rb |