Class: HTTPResponse
- Inherits:
-
Object
- Object
- HTTPResponse
- Defined in:
- lib/response/HTTPResponse.rb,
lib/response/mms/HTTPResponse.rb,
lib/response/sms/HTTPResponse.rb
Instance Method Summary collapse
- #getCode ⇒ Object
- #getContent ⇒ Object
- #getContentType ⇒ Object
- #getHTTPResponseCode ⇒ Object
- #getLocation ⇒ Object
-
#initialize ⇒ HTTPResponse
constructor
A new instance of HTTPResponse.
- #initializeJSON(jsondict) ⇒ Object
- #setCode(code) ⇒ Object
- #setContent(content) ⇒ Object
- #setContentType(contentType) ⇒ Object
- #setHTTPResponseCode(httpResponseCode) ⇒ Object
- #setLocation(location) ⇒ Object
Constructor Details
#initialize ⇒ HTTPResponse
Returns a new instance of HTTPResponse.
4 5 6 7 8 9 |
# File 'lib/response/HTTPResponse.rb', line 4 def initialize @code=0 @content=nil @contentType=nil @location=nil end |
Instance Method Details
#getCode ⇒ Object
30 31 32 |
# File 'lib/response/HTTPResponse.rb', line 30 def getCode @code end |
#getContent ⇒ Object
38 39 40 |
# File 'lib/response/HTTPResponse.rb', line 38 def getContent @content end |
#getContentType ⇒ Object
46 47 48 |
# File 'lib/response/HTTPResponse.rb', line 46 def getContentType @contentType end |
#getHTTPResponseCode ⇒ Object
10 11 12 |
# File 'lib/response/mms/HTTPResponse.rb', line 10 def getHTTPResponseCode @httpResponseCode end |
#getLocation ⇒ Object
54 55 56 |
# File 'lib/response/HTTPResponse.rb', line 54 def getLocation @location end |
#initializeJSON(jsondict) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/response/HTTPResponse.rb', line 11 def initializeJSON(jsondict) @code=0 if (jsondict!=nil) && (jsondict.has_key?'code') && (jsondict['code']!=nil) @code=jsondict['code'].to_i end @content=nil if (jsondict!=nil) && (jsondict.has_key?'content') && (jsondict['content']!=nil) @content=jsondict['content'] end @contentType=nil if (jsondict!=nil) && (jsondict.has_key?'contentType') && (jsondict['contentType']!=nil) @contentType=jsondict['contentType'] end @location=nil if (jsondict!=nil) && (jsondict.has_key?'location') && (jsondict['location']!=nil) @location=jsondict['location'] end end |
#setCode(code) ⇒ Object
34 35 36 |
# File 'lib/response/HTTPResponse.rb', line 34 def setCode(code) @code=code end |
#setContent(content) ⇒ Object
42 43 44 |
# File 'lib/response/HTTPResponse.rb', line 42 def setContent(content) @content=content end |
#setContentType(contentType) ⇒ Object
50 51 52 |
# File 'lib/response/HTTPResponse.rb', line 50 def setContentType(contentType) @contentType=contentType end |
#setHTTPResponseCode(httpResponseCode) ⇒ Object
14 15 16 |
# File 'lib/response/mms/HTTPResponse.rb', line 14 def setHTTPResponseCode(httpResponseCode) @httpResponseCode=httpResponseCode end |
#setLocation(location) ⇒ Object
58 59 60 |
# File 'lib/response/HTTPResponse.rb', line 58 def setLocation(location) @location=location end |