Sha256: 18d8a29bdb024e9d807147c989c04a122ab2174de0745fd10bf9f0349ed12fba

Contents?: true

Size: 768 Bytes

Versions: 9

Compression:

Stored size: 768 Bytes

Contents

require 'genesis_ruby/network/base_network'
require 'genesis_ruby/network/adapter/net_http_adapter'

module GenesisRuby
  module Network
    # Net HTTP Network module
    class NetHttp < BaseNetwork

      # JSON Response Type
      def xml?
        response_headers['content-type'].downcase.include?(BaseNetwork::XML_HEADER)
      end

      # JSON Response Type
      def json?
        response_headers['content-type'].downcase.include?(BaseNetwork::JSON_HEADER)
      end

      # HTML Response Type
      def html?
        response_headers['content-type'].downcase.include?(BaseNetwork::HTML_HEADER)
      end

      protected

      # Adapter Initialization
      def factory
        GenesisRuby::Network::Adapter::NetHttpAdapter.new
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
genesis_ruby-0.2.0 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.9 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.8 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.7 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.6 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.5 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.4 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.3 lib/genesis_ruby/network/net_http.rb
genesis_ruby-0.1.2 lib/genesis_ruby/network/net_http.rb