summaryrefslogtreecommitdiff
path: root/lib/github/issues.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/github/issues.rb')
-rw-r--r--lib/github/issues.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/github/issues.rb b/lib/github/issues.rb
new file mode 100644
index 00000000000..27843e1cdd8
--- /dev/null
+++ b/lib/github/issues.rb
@@ -0,0 +1,20 @@
+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