Class: GithubIssueRequest::Url
- Inherits:
-
Object
- Object
- GithubIssueRequest::Url
- Defined in:
- lib/github_issue_request/url.rb
Constant Summary collapse
- GITHUB_BASE_URL =
"https://github.com"
Class Method Summary collapse
Instance Method Summary collapse
Constructor Details
#initialize(options = {}) ⇒ GithubIssueRequest::Url
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/github_issue_request/url.rb', line 14 def initialize( = {}) = .dup owner = .delete(:owner) repo = .delete(:repo) @owner = owner || @@owner @repo = repo || @@repo @options = raise NotSetOwnerRepoError if @owner.nil? || @repo.nil? @url = "#{GITHUB_BASE_URL}/#{@owner}/#{@repo}/issues/new" @url += "?#{@options.to_query}" unless .empty? end |
Class Method Details
.config(owner, repo) ⇒ Object
6 7 8 9 |
# File 'lib/github_issue_request/url.rb', line 6 def config(owner, repo) @@owner = owner @@repo = repo end |
Instance Method Details
#to_s ⇒ String
29 30 31 |
# File 'lib/github_issue_request/url.rb', line 29 def to_s @url end |