Class: Marlens::GithubToJiraComment::GithubUrl::Source

Inherits:
Struct
  • Object
show all
Defined in:
lib/marlens/github_to_jira_comment/github_url.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



8
9
10
# File 'lib/marlens/github_to_jira_comment/github_url.rb', line 8

def number
  @number
end

#ownerObject

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



8
9
10
# File 'lib/marlens/github_to_jira_comment/github_url.rb', line 8

def owner
  @owner
end

#repoObject

Returns the value of attribute repo

Returns:

  • (Object)

    the current value of repo



8
9
10
# File 'lib/marlens/github_to_jira_comment/github_url.rb', line 8

def repo
  @repo
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



8
9
10
# File 'lib/marlens/github_to_jira_comment/github_url.rb', line 8

def type
  @type
end

Instance Method Details

#api_pathObject



9
10
11
12
# File 'lib/marlens/github_to_jira_comment/github_url.rb', line 9

def api_path
  collection = type == "pull" ? "pulls" : "issues"
  "/repos/#{owner}/#{repo}/#{collection}/#{number}"
end

#contextObject



14
15
16
# File 'lib/marlens/github_to_jira_comment/github_url.rb', line 14

def context
  "#{owner}/#{repo}"
end