Class: OpenGithubIssue::GithubIssue

Inherits:
BaseService show all
Defined in:
lib/open_github_issue/github_issue.rb

Instance Method Summary collapse

Methods inherited from BaseService

call

Constructor Details

#initialize(title, message) ⇒ GithubIssue

Returns a new instance of GithubIssue.



3
4
5
6
# File 'lib/open_github_issue/github_issue.rb', line 3

def initialize(title, message)
  @title = title
  @message = message
end

Instance Method Details

#callObject



8
9
10
# File 'lib/open_github_issue/github_issue.rb', line 8

def call
  client.create_issue(repo, @title, @message)
end

#clientObject



12
13
14
# File 'lib/open_github_issue/github_issue.rb', line 12

def client
  @client ||= Octokit::Client.new(access_token: OpenGithubIssue.configuration.github_access_token)
end

#repoObject



16
17
18
# File 'lib/open_github_issue/github_issue.rb', line 16

def repo
  @repo ||= OpenGithubIssue.configuration.github_repo
end