Class: Geet::Github::Issue

Inherits:
AbstractIssue show all
Extended by:
T::Sig
Defined in:
lib/geet/github/issue.rb

Instance Attribute Summary

Attributes inherited from AbstractIssue

#link, #number, #title

Class Method Summary collapse

Methods inherited from AbstractIssue

#add_labels, #assign_users, #comment, #edit, #initialize

Constructor Details

This class inherits a constructor from Geet::Github::AbstractIssue

Class Method Details

.create(title, description, api_interface) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/geet/github/issue.rb', line 16

def self.create(title, description, api_interface)
  api_path = "issues"
  request_data = {title:, body: description}

  response = T.cast(
    api_interface.send_request(api_path, data: request_data),
    T::Hash[String, T.untyped]
  )

  issue_number = T.cast(response.fetch("number"), Integer)
  title = T.cast(response.fetch("title"), String)
  link = T.cast(response.fetch("html_url"), String)

  new(issue_number, api_interface, title, link)
end

.list(api_interface, assignee: nil, milestone: nil, &type_filter) ⇒ Object



43
44
45
46
47
# File 'lib/geet/github/issue.rb', line 43

def self.list(api_interface, assignee: nil, milestone: nil, &type_filter)
  super do |issue_data|
    !issue_data.key?("pull_request")
  end
end