Class: HornOfPlenty::Adapters::Github::Requests::ListPullRequests
- Inherits:
-
Request
- Object
- Request
- HornOfPlenty::Adapters::Github::Requests::ListPullRequests
- Defined in:
- lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#pagination ⇒ Object
Returns the value of attribute pagination.
-
#query ⇒ Object
Returns the value of attribute query.
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
-
#initialize(format: 'raw', pagination: {}, query: {}, repository:) ⇒ ListPullRequests
constructor
A new instance of ListPullRequests.
- #method ⇒ Object
- #path ⇒ Object
- #to_h ⇒ Object (also: #to_params)
Methods inherited from Request
Constructor Details
#initialize(format: 'raw', pagination: {}, query: {}, repository:) ⇒ ListPullRequests
Returns a new instance of ListPullRequests.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 14 def initialize(format: 'raw', pagination: {}, query: {}, repository:) self.format = format self.pagination = pagination self.query = query self.repository = repository end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
9 10 11 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 9 def format @format end |
#pagination ⇒ Object
Returns the value of attribute pagination.
9 10 11 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 9 def pagination @pagination end |
#query ⇒ Object
Returns the value of attribute query.
9 10 11 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 9 def query @query end |
#repository ⇒ Object
Returns the value of attribute repository.
9 10 11 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 9 def repository @repository end |
Instance Method Details
#method ⇒ Object
25 26 27 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 25 def method 'get' end |
#path ⇒ Object
29 30 31 32 33 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 29 def path return "repos/#{repository}/pulls" unless query[:id] "repos/#{repository}/pulls/#{query[:id]}" end |
#to_h ⇒ Object Also known as: to_params
35 36 37 38 |
# File 'lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb', line 35 def to_h @to_h ||= query_class.new(query).to_h. merge(pagination_hash) end |