Remove unused GitHub endpoint wrappers

parent 4f68dc4f
module Github
class Issues
attr_reader :owner, :repo
def initialize(owner, repo)
@owner = owner
@repo = repo
end
def fetch
Collection.new(issues_url).fetch(state: :all, sort: :created, direction: :asc, per_page: 10)
end
private
def issues_url
"/repos/#{owner}/#{repo}/issues"
end
end
end
module Github
class Labels
attr_reader :owner, :repo
def initialize(owner, repo)
@owner = owner
@repo = repo
end
def fetch
Collection.new(labels_url).fetch
end
private
def labels_url
"/repos/#{owner}/#{repo}/labels"
end
end
end
module Github
class Milestones
attr_reader :owner, :repo
def initialize(owner, repo)
@owner = owner
@repo = repo
end
def fetch
Collection.new(milestones_url).fetch
end
private
def milestones_url
"/repos/#{owner}/#{repo}/milestones"
end
end
end
module Github
class PullRequests
attr_reader :owner, :repo
def initialize(owner, repo)
@owner = owner
@repo = repo
end
def fetch
Collection.new(pull_requests_url).fetch(state: :all, sort: :created, direction: :asc)
end
private
def pull_requests_url
"/repos/#{owner}/#{repo}/pulls"
end
end
end
module Github
class Releases
attr_reader :owner, :repo
def initialize(owner, repo)
@owner = owner
@repo = repo
end
def fetch
Collection.new(releases_url).fetch
end
private
def releases_url
"/repos/#{owner}/#{repo}/releases"
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment