Class: Gem::Release::Helper::Http::Client

Inherits:
Struct
  • Object
show all
Defined in:
lib/gem/release/helper/http.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



8
9
10
# File 'lib/gem/release/helper/http.rb', line 8

def body
  @body
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



8
9
10
# File 'lib/gem/release/helper/http.rb', line 8

def headers
  @headers
end

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



8
9
10
# File 'lib/gem/release/helper/http.rb', line 8

def method
  @method
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



8
9
10
# File 'lib/gem/release/helper/http.rb', line 8

def url
  @url
end

Instance Method Details

#requestObject



9
10
11
12
13
14
# File 'lib/gem/release/helper/http.rb', line 9

def request
  req = const.new(uri.request_uri, headers)
  req.body = body if body
  resp = client.request(req)
  [resp.code.to_i, resp.body]
end