Class: TingYun::Http::CurbResponse
Constant Summary
AbstractRequest::ERROR_MESSAGE
Instance Method Summary
collapse
#[]=, #from
Constructor Details
Returns a new instance of CurbResponse.
52
53
54
55
|
# File 'lib/ting_yun/http/curb_wrappers.rb', line 52
def initialize(curlobj)
@headers = {}
@curlobj = curlobj
end
|
Instance Method Details
#[](key) ⇒ Object
57
58
59
|
# File 'lib/ting_yun/http/curb_wrappers.rb', line 57
def [](key)
@headers[ key.downcase ]
end
|
65
66
67
68
69
70
|
# File 'lib/ting_yun/http/curb_wrappers.rb', line 65
def ( data )
key, value = data.split( /:\s*/, 2 )
@headers[ key.downcase ] = value
@curlobj. ||= ''
@curlobj. << data
end
|
#to_hash ⇒ Object
61
62
63
|
# File 'lib/ting_yun/http/curb_wrappers.rb', line 61
def to_hash
@headers.dup
end
|