Class: RAWS::HTTP::HT2P::Response
- Defined in:
- lib/raws/http/ht2p.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
- #code ⇒ Object
- #header ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #parse(params = {}) ⇒ Object
- #receive(&block) ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
59 60 61 |
# File 'lib/raws/http/ht2p.rb', line 59 def initialize(response) @response, @body, @doc = response, nil, nil end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
57 58 59 |
# File 'lib/raws/http/ht2p.rb', line 57 def body @body end |
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
57 58 59 |
# File 'lib/raws/http/ht2p.rb', line 57 def doc @doc end |
Instance Method Details
#code ⇒ Object
63 64 65 |
# File 'lib/raws/http/ht2p.rb', line 63 def code @response.code end |
#header ⇒ Object
67 68 69 |
# File 'lib/raws/http/ht2p.rb', line 67 def header @response.header end |
#parse(params = {}) ⇒ Object
79 80 81 |
# File 'lib/raws/http/ht2p.rb', line 79 def parse(params={}) @doc = RAWS.xml.parse(receive, params) end |
#receive(&block) ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/raws/http/ht2p.rb', line 71 def receive(&block) if block_given? @response.receive(&block) else @body = @response.receive end end |