class HornOfPlenty::Adapters::Github::Requests::ListPullRequests

Attributes

format[RW]
pagination[RW]
query[RW]
repository[RW]

Public Class Methods

new(format: 'raw', pagination: {}, query: {}, repository:) click to toggle source
# 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

Public Instance Methods

method() click to toggle source
# File lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb, line 25
def method
  'get'
end
path() click to toggle source
# 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() click to toggle source
# 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
Also aliased as: to_params
to_params()
Alias for: to_h

Private Instance Methods

pagination_hash() click to toggle source
# File lib/horn_of_plenty/adapters/github/requests/list_pull_requests.rb, line 43
def pagination_hash
  pagination.to_h
end