Class: Sitespec::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/sitespec/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, header, body) ⇒ Response

Returns a new instance of Response.



5
6
7
8
9
# File 'lib/sitespec/response.rb', line 5

def initialize(status, header, body)
  @body = body
  @header = header
  @status = status
end

Instance Attribute Details

#headerObject (readonly)

Returns the value of attribute header.



3
4
5
# File 'lib/sitespec/response.rb', line 3

def header
  @header
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/sitespec/response.rb', line 3

def status
  @status
end

Instance Method Details

#bodyObject



11
12
13
14
15
# File 'lib/sitespec/response.rb', line 11

def body
  lines = []
  @body.each {|line| lines << line }
  lines.join
end