Class: Vzaar::Response::Base
- Inherits:
-
Struct
- Object
- Struct
- Vzaar::Response::Base
show all
- Includes:
- Helper
- Defined in:
- lib/vzaar/response/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Helper
#blank?, #hash_to_xml, #symb_keys
Instance Attribute Details
#res ⇒ Object
Returns the value of attribute res
3
4
5
|
# File 'lib/vzaar/response/base.rb', line 3
def res
@res
end
|
Instance Method Details
#body ⇒ Object
6
7
8
|
# File 'lib/vzaar/response/base.rb', line 6
def body
json? ? JSON.parse(res.body) : res.body
end
|
#content_type ⇒ Object
10
11
12
|
# File 'lib/vzaar/response/base.rb', line 10
def content_type
@content_type ||= res.content_type
end
|
#json? ⇒ Boolean
14
15
16
|
# File 'lib/vzaar/response/base.rb', line 14
def json?
content_type == "application/json"
end
|