Sha256: 31abdabe39f78eb3b2b69ee933943df32883ec2cc679aa409dc582f584b50101

Contents?: true

Size: 705 Bytes

Versions: 19

Compression:

Stored size: 705 Bytes

Contents

# -*- coding: utf-8 -*-
module Libgss
  class AssetRequest

    STATUS_PREPARING = 0
    STATUS_SENDING   = 1
    STATUS_WAITING   = 2
    STATUS_RECEIVED  = 3
    STATUS_SUCCESS   = 4
    STATUS_ERROR     = 5
    STATUS_TIMEOUT   = 6

    attr_reader :url, :req_headers, :status, :response_data

    # コンストラクタ
    def initialize(httpclient, url, req_headers)
      @httpclient = httpclient
      @url = url
      @req_headers = req_headers
      @response_data = nil
      @status = STATUS_PREPARING
    end

    def send_request(&callback)
      res = @httpclient.get(url, nil, req_headers)
      @response_data = res.body
      callback.call(@response_data) if callback
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
libgss-0.11.0 lib/libgss/asset_request.rb
libgss-0.10.0 lib/libgss/asset_request.rb
libgss-0.9.0 lib/libgss/asset_request.rb
libgss-0.8.4 lib/libgss/asset_request.rb
libgss-0.8.3 lib/libgss/asset_request.rb
libgss-0.8.2 lib/libgss/asset_request.rb
libgss-0.8.1 lib/libgss/asset_request.rb
libgss-0.8.0 lib/libgss/asset_request.rb
libgss-0.7.6 lib/libgss/asset_request.rb
libgss-0.7.5 lib/libgss/asset_request.rb
libgss-0.7.4 lib/libgss/asset_request.rb
libgss-0.7.3 lib/libgss/asset_request.rb
libgss-0.7.2 lib/libgss/asset_request.rb
libgss-0.7.1 lib/libgss/asset_request.rb
libgss-0.7.0 lib/libgss/asset_request.rb
libgss-0.6.2 lib/libgss/asset_request.rb
libgss-0.6.1 lib/libgss/asset_request.rb
libgss-0.6.0 lib/libgss/asset_request.rb
libgss-0.5.0 lib/libgss/asset_request.rb