Class: NucleusCore::CsvResponse

Inherits:
ResponseAdapter show all
Defined in:
lib/nucleus_core/response_adapters/csv_response.rb

Instance Attribute Summary

Attributes inherited from SimpleObject

#__attributes__

Instance Method Summary collapse

Methods inherited from SimpleObject

#to_h

Constructor Details

#initialize(attrs = {}) ⇒ CsvResponse

Returns a new instance of CsvResponse.



4
5
6
7
8
9
10
11
12
# File 'lib/nucleus_core/response_adapters/csv_response.rb', line 4

def initialize(attrs={})
  attrs = attrs.merge(
    disposition: "attachment",
    filename: attrs.fetch(:filename) { "response.csv" },
    type: "text/csv; charset=UTF-8;"
  )

  super(attrs)
end