Class: PullRequestAi::Repo::Client
- Inherits:
-
Object
- Object
- PullRequestAi::Repo::Client
- Defined in:
- lib/pull_request_ai/repo/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#http_timeout ⇒ Object
readonly
Returns the value of attribute http_timeout.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http_timeout, api_endpoint) ⇒ Client
constructor
Initializes the client.
- #open_pull_request(slug, head, base, title, description) ⇒ Object
- #opened_pull_requests(slug, head, base) ⇒ Object
- #update_pull_request(slug, number, base, title, description) ⇒ Object
Constructor Details
#initialize(http_timeout, api_endpoint) ⇒ Client
Initializes the client.
11 12 13 14 |
# File 'lib/pull_request_ai/repo/client.rb', line 11 def initialize(http_timeout, api_endpoint) @http_timeout = http_timeout @api_endpoint = api_endpoint end |
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
7 8 9 |
# File 'lib/pull_request_ai/repo/client.rb', line 7 def api_endpoint @api_endpoint end |
#http_timeout ⇒ Object (readonly)
Returns the value of attribute http_timeout.
6 7 8 |
# File 'lib/pull_request_ai/repo/client.rb', line 6 def http_timeout @http_timeout end |
Class Method Details
.client_from_host(host) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/pull_request_ai/repo/client.rb', line 29 def client_from_host(host) result = host.success? ? host.success : '' case result when 'github.com' PullRequestAi::GitHub::Client.new when 'bitbucket.org' PullRequestAi::Bitbucket::Client.new else PullRequestAi::Repo::Client.new end end |
Instance Method Details
#open_pull_request(slug, head, base, title, description) ⇒ Object
24 25 26 |
# File 'lib/pull_request_ai/repo/client.rb', line 24 def open_pull_request(slug, head, base, title, description) Error.failure(:project_not_configured) end |