Class: OpenID::Server::WebResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/openid/server.rb

Overview

I am a response to an OpenID request in terms a web server understands.

I generally come from an #Encoder, either directly or from #Server.encodeResponse.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code = HTTP_OK, headers = nil, body = "") ⇒ WebResponse

Returns a new instance of WebResponse.



964
965
966
967
968
969
970
971
972
973
974
975
976
977
# File 'lib/openid/server.rb', line 964

def initialize(code=HTTP_OK, headers=nil, body="")
  # Construct me.
  #
  # These parameters are assigned directly as class attributes,
  # see my class documentation for their
  # descriptions.
  @code = code
  if headers
    @headers = headers
  else
    @headers = {}
  end
  @body = body
end

Instance Attribute Details

#bodyObject

The body of this response.



962
963
964
# File 'lib/openid/server.rb', line 962

def body
  @body
end

#codeObject

The HTTP code of this response as an integer.



956
957
958
# File 'lib/openid/server.rb', line 956

def code
  @code
end

#headersObject

#Hash of headers to include in this response.



959
960
961
# File 'lib/openid/server.rb', line 959

def headers
  @headers
end