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.
5 6 7 8 9 |
# File 'lib/openpull/pull_request_fetcher.rb', line 5 def initialize(client, organisation, username = '') @client = client @organisation = organisation @username = username end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/openpull/pull_request_fetcher.rb', line 3 def client @client end |
#organisation ⇒ Object (readonly)
Returns the value of attribute organisation.
3 4 5 |
# File 'lib/openpull/pull_request_fetcher.rb', line 3 def organisation @organisation end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
3 4 5 |
# File 'lib/openpull/pull_request_fetcher.rb', line 3 def username @username end |
Instance Method Details
#fetch ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/openpull/pull_request_fetcher.rb', line 11 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 |