Class: Baidu::Response
- Inherits:
-
Object
- Object
- Baidu::Response
- Defined in:
- lib/baidu/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#header ⇒ Object
Returns the value of attribute header.
-
#oprs ⇒ Object
Returns the value of attribute oprs.
-
#oprtime ⇒ Object
Returns the value of attribute oprtime.
-
#quota ⇒ Object
Returns the value of attribute quota.
-
#rquota ⇒ Object
Returns the value of attribute rquota.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response, name_response_sym) ⇒ Response
constructor
A new instance of Response.
Constructor Details
permalink #initialize(response, name_response_sym) ⇒ Response
Returns a new instance of Response.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/baidu/response.rb', line 4 def initialize(response,name_response_sym) @header = response.header[:res_header] @body = response.body[name_response_sym] @rquota = @header[:rquota].to_i @quota = @header[:quota].to_i @status = @header[:status].to_i @desc = @header[:desc] @oprs = @header[:oprs] @oprtime = @header[:oprtime] end |
Instance Attribute Details
permalink #body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def body @body end |
permalink #desc ⇒ Object
Returns the value of attribute desc.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def desc @desc end |
permalink #header ⇒ Object
Returns the value of attribute header.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def header @header end |
permalink #oprs ⇒ Object
Returns the value of attribute oprs.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def oprs @oprs end |
permalink #oprtime ⇒ Object
Returns the value of attribute oprtime.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def oprtime @oprtime end |
permalink #quota ⇒ Object
Returns the value of attribute quota.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def quota @quota end |
permalink #rquota ⇒ Object
Returns the value of attribute rquota.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def rquota @rquota end |
permalink #status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/baidu/response.rb', line 3 def status @status end |