Module: Decisive::DSL
- Defined in:
- lib/decisive/template_handler.rb
Instance Method Summary collapse
- #csv(records, filename:, stream: true, &block) ⇒ Object
- #xls(worksheets, filename:, &block) ⇒ Object
Instance Method Details
#csv(records, filename:, stream: true, &block) ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'lib/decisive/template_handler.rb', line 58 def csv records, filename:, stream: true, &block if stream raise StreamingNotEnabledByControllerError unless controller.is_a?(ActionController::Live) raise StreamIncompatibleBlockArgumentError if block.arity != 0 StreamContext.new([], records, filename, &block) else RenderContext.new(records, filename, block) end end |
#xls(worksheets, filename:, &block) ⇒ Object
68 69 70 |
# File 'lib/decisive/template_handler.rb', line 68 def xls worksheets, filename:, &block XLSContext.new(worksheets, filename, block) end |