Class: Gitlab::FogbugzImport::HttpAdapter
- Inherits:
-
Object
- Object
- Gitlab::FogbugzImport::HttpAdapter
- Defined in:
- lib/gitlab/fogbugz_import/http_adapter.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ HttpAdapter
constructor
A new instance of HttpAdapter.
- #request(action, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ HttpAdapter
Returns a new instance of HttpAdapter.
6 7 8 |
# File 'lib/gitlab/fogbugz_import/http_adapter.rb', line 6 def initialize( = {}) @root_url = [:uri] end |
Instance Method Details
#request(action, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/gitlab/fogbugz_import/http_adapter.rb', line 10 def request(action, = {}) uri = Gitlab::Utils.append_path(@root_url, 'api.asp') params = { 'cmd' => action }.merge(.fetch(:params, {})) response = Gitlab::HTTP.post(uri, body: params) response.body end |