Sha256: 290980606cf7f4c35dda3fc1bcb7e2e1c035838795dbd55a4af65e830059cab0

Contents?: true

Size: 559 Bytes

Versions: 1

Compression:

Stored size: 559 Bytes

Contents

require 'nicoapi/http_client'


module NicoAPI
  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 = NicoAPI::HttpClient.instance
      http_client.set_params uri.to_s
      http_client.get
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nicoapi-0.0.1 lib/nicoapi/base.rb