Class: RAWS::HTTP::HT2P::Response

Inherits:
Response
  • Object
show all
Defined in:
lib/raws/http/ht2p.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



57
58
59
# File 'lib/raws/http/ht2p.rb', line 57

def body
  @body
end

#docObject (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

#codeObject



63
64
65
# File 'lib/raws/http/ht2p.rb', line 63

def code
  @response.code
end

#headerObject



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