Module: TemplateStreaming::Response

Defined in:
lib/template_streaming.rb

Overview

Only prepare once.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



214
215
216
217
# File 'lib/template_streaming.rb', line 214

def self.included(base)
  base.alias_method_chain :prepare!, :template_streaming
  base.alias_method_chain :set_content_length!, :template_streaming
end

Instance Method Details

#prepare_with_template_streaming!Object



219
220
221
222
223
# File 'lib/template_streaming.rb', line 219

def prepare_with_template_streaming!
  return if defined?(@prepared)
  prepare_without_template_streaming!
  @prepared = true
end

#set_content_length_with_template_streaming!Object



225
226
227
228
229
230
231
# File 'lib/template_streaming.rb', line 225

def set_content_length_with_template_streaming!
  if body.is_a?(StreamingBody)
    # pass
  else
    set_content_length_without_template_streaming!
  end
end