Class: Ekuseru::TemplateHandler::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/template_handler/options.rb

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ Options

Returns a new instance of Options.



5
6
7
8
# File 'lib/template_handler/options.rb', line 5

def initialize controller
  @controller = controller
  @controller.response.content_type ||= Mime::XLS
end

Instance Method Details

#set_disposition(filename = nil) ⇒ Object



10
11
12
# File 'lib/template_handler/options.rb', line 10

def set_disposition(filename = nil)
  @controller.headers["Content-Disposition"] = ["attachment", filename ? "filename=\"#{filename}\"" : nil].compact.join(';')
end