Class: Decidim::GithubManager::Querier::ByIssueId
- Defined in:
- lib/decidim/github_manager/querier/by_issue_id.rb
Overview
Makes a GET request for the metadata of an Issue or Pull Request in GitHub
Instance Method Summary collapse
-
#call ⇒ Hash
Makes the GET request and parses the response of an Issue or Pull Request in GitHub.
-
#initialize(issue_id:, token:) ⇒ ByIssueId
constructor
A new instance of ByIssueId.
Constructor Details
#initialize(issue_id:, token:) ⇒ ByIssueId
Returns a new instance of ByIssueId.
12 13 14 15 |
# File 'lib/decidim/github_manager/querier/by_issue_id.rb', line 12 def initialize(issue_id:, token:) @issue_id = issue_id @token = token end |
Instance Method Details
#call ⇒ Hash
Makes the GET request and parses the response of an Issue or Pull Request in GitHub
20 21 22 23 24 25 |
# File 'lib/decidim/github_manager/querier/by_issue_id.rb', line 20 def call data = json_response("https://api.github.com/repos/decidim/decidim/issues/#{@issue_id}") return unless data["number"] parse(data) end |