Class: Decidim::GithubManager::Querier::RelatedIssues

Inherits:
Base
  • Object
show all
Defined in:
lib/decidim/github_manager/querier/related_issues.rb

Overview

Makes a GET request for the related issues of an Issue or Pull Request in GitHub Uses the Timeline events API endpoint

Instance Method Summary collapse

Constructor Details

#initialize(issue_id:, token:) ⇒ RelatedIssues

Returns a new instance of RelatedIssues.



13
14
15
16
# File 'lib/decidim/github_manager/querier/related_issues.rb', line 13

def initialize(issue_id:, token:)
  @issue_id = issue_id
  @token = token
end

Instance Method Details

#callHash

Makes the GET request and parses the response of an Issue or Pull Request in GitHub

Returns:

  • (Hash)


21
22
23
# File 'lib/decidim/github_manager/querier/related_issues.rb', line 21

def call
  parse(json_response("https://api.github.com/repos/decidim/decidim/issues/#{@issue_id}/timeline"))
end