Class: WhatsupGithub::Pulls

Inherits:
Object
  • Object
show all
Defined in:
lib/whatsup_github/pulls.rb

Overview

Gets issues found on GitHub by query

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Pulls

Returns a new instance of Pulls.



13
14
15
16
# File 'lib/whatsup_github/pulls.rb', line 13

def initialize(args = {})
  @repo = args[:repo]
  @since = args[:since]
end

Instance Attribute Details

#repoObject (readonly)

Returns the value of attribute repo.



11
12
13
# File 'lib/whatsup_github/pulls.rb', line 11

def repo
  @repo
end

#sinceObject (readonly)

Returns the value of attribute since.



11
12
13
# File 'lib/whatsup_github/pulls.rb', line 11

def since
  @since
end

Instance Method Details

#dataObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/whatsup_github/pulls.rb', line 18

def data
  pull_requests = []
  filtered_numbers.each do |number|
    pull_requests << if @repo.start_with? 'enterprise:'
                       enterprise_client.pull_request(@repo, number)
                     else
                       client.pull_request(@repo, number)
                     end
  end
  pull_requests
end