Sha256: 767bc85f64862727358b94a837e7161d0400fce900e39c98abd1798b34535424

Contents?: true

Size: 644 Bytes

Versions: 3

Compression:

Stored size: 644 Bytes

Contents

require 'nicoquery/core/http_client'


module NicoQuery
  module Core
    module Base
      def scheme
        'http'
      end

      def params
        @params_array.join('&')
      end

      def path
        if @dynamic_segment.present?
          static_segment + '/' + @dynamic_segment
        else
          static_segment
        end
      end

      def uri
        _uri = scheme + "://" + [ ([host, path].join('/')), params].join('?')
        URI.escape _uri
      end

      def get
        http_client = NicoQuery::Core::HttpClient.instance
        http_client.set_params uri.to_s
        http_client.get
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nicoquery-core-0.0.5.2 lib/nicoquery/core/base.rb
nicoquery-core-0.0.5.1 lib/nicoquery/core/base.rb
nicoquery-core-0.0.5 lib/nicoquery/core/base.rb