Class: FSR::Listener::HeaderAndContentResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/fsr/listener/header_and_content_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ HeaderAndContentResponse

Returns a new instance of HeaderAndContentResponse.



9
10
11
12
13
# File 'lib/fsr/listener/header_and_content_response.rb', line 9

def initialize(args = {})
  @headers = args[:headers]
  @content =  args[:content]
  strip_newlines
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



7
8
9
# File 'lib/fsr/listener/header_and_content_response.rb', line 7

def content
  @content
end

#headersObject (readonly)

Returns the value of attribute headers.



7
8
9
# File 'lib/fsr/listener/header_and_content_response.rb', line 7

def headers
  @headers
end

Instance Method Details

#bodyObject

Keep backward compat with the other 2 people who use FSR



20
21
22
# File 'lib/fsr/listener/header_and_content_response.rb', line 20

def body
  @content
end

#strip_newlinesObject



15
16
17
# File 'lib/fsr/listener/header_and_content_response.rb', line 15

def strip_newlines
  @content.each {|k,v| v.chomp! if v.is_a?(String)}
end