Class: GenesisRuby::Network::NetHttp
- Inherits:
-
BaseNetwork
- Object
- BaseNetwork
- GenesisRuby::Network::NetHttp
- Defined in:
- lib/genesis_ruby/network/net_http.rb
Overview
Net HTTP Network module
Constant Summary
Constants inherited from BaseNetwork
BaseNetwork::HTML_HEADER, BaseNetwork::JSON_HEADER, BaseNetwork::XML_HEADER
Instance Method Summary collapse
-
#html? ⇒ Boolean
HTML Response Type.
-
#json? ⇒ Boolean
JSON Response Type.
-
#xml? ⇒ Boolean
JSON Response Type.
Methods inherited from BaseNetwork
#error?, #init_api_data, #initialize, #response_body, #response_headers, #send_request, #server_message
Constructor Details
This class inherits a constructor from GenesisRuby::Network::BaseNetwork
Instance Method Details
#html? ⇒ Boolean
HTML Response Type
22 23 24 |
# File 'lib/genesis_ruby/network/net_http.rb', line 22 def html? response_headers['content-type'].downcase.include?(BaseNetwork::HTML_HEADER) end |
#json? ⇒ Boolean
JSON Response Type
17 18 19 |
# File 'lib/genesis_ruby/network/net_http.rb', line 17 def json? response_headers['content-type'].downcase.include?(BaseNetwork::JSON_HEADER) end |
#xml? ⇒ Boolean
JSON Response Type
12 13 14 |
# File 'lib/genesis_ruby/network/net_http.rb', line 12 def xml? response_headers['content-type'].downcase.include?(BaseNetwork::XML_HEADER) end |