Class: Bl::Commands::PullRequest

Inherits:
Bl::Command show all
Defined in:
lib/bl/commands/pull_request.rb

Instance Method Summary collapse

Methods included from Printer

print_response, printable_issues

Methods included from Requestable

client, formatter, request

Constructor Details

#initializePullRequest

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