Class: Bl::Commands::PullRequest
- Inherits:
-
Bl::Command
- Object
- Thor
- Bl::Command
- Bl::Commands::PullRequest
- Defined in:
- lib/bl/commands/pull_request.rb
Instance Method Summary collapse
- #count(id) ⇒ Object
-
#initialize ⇒ PullRequest
constructor
A new instance of PullRequest.
- #list(id) ⇒ Object
Methods included from Printer
print_response, printable_issues
Methods included from Requestable
Constructor Details
#initialize ⇒ PullRequest
Returns a new instance of PullRequest.
4 5 6 7 8 |
# File 'lib/bl/commands/pull_request.rb', line 4 def initialize(*) @config = Bl::Config.instance @url = "projects/#{@config[:project_key]}/git/repositories" super end |
Instance Method Details
#count(id) ⇒ Object
11 12 13 14 |
# File 'lib/bl/commands/pull_request.rb', line 11 def count(id) res = request(:get, "#{@url}/#{id}/pullRequests/count") puts res.body.count end |
#list(id) ⇒ Object
17 18 19 20 |
# File 'lib/bl/commands/pull_request.rb', line 17 def list(id) res = request(:get, "#{@url}/#{id}/pullRequests") print_response(res, :pull_request) end |