Class: OpenPull::PullRequestFetcher
- Inherits:
-
Object
- Object
- OpenPull::PullRequestFetcher
- Defined in:
- lib/openpull/pull_request_fetcher.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#organisation ⇒ Object
readonly
Returns the value of attribute organisation.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(client, organisation, username = '') ⇒ PullRequestFetcher
constructor
A new instance of PullRequestFetcher.
Constructor Details
#initialize(client, organisation, username = '') ⇒ PullRequestFetcher
Returns a new instance of PullRequestFetcher.
7 8 9 10 11 |
# File 'lib/openpull/pull_request_fetcher.rb', line 7 def initialize(client, organisation, username = '') @client = client @organisation = organisation @username = username end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/openpull/pull_request_fetcher.rb', line 5 def client @client end |
#organisation ⇒ Object (readonly)
Returns the value of attribute organisation.
5 6 7 |
# File 'lib/openpull/pull_request_fetcher.rb', line 5 def organisation @organisation end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/openpull/pull_request_fetcher.rb', line 5 def username @username end |
Instance Method Details
#fetch ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/openpull/pull_request_fetcher.rb', line 13 def fetch repos = client.org_repos(organisation).map do |repository| Thread.new { fetch_pull_requests(repository) } end.map(&:value) repos.reject { |v| v.nil? || v.empty? } end |