summaryrefslogtreecommitdiff
path: root/lib/github/issues.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-11 22:33:54 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-24 16:17:52 -0300
commitfc42f3dffa364a360c76ff2785813d74f42016c7 (patch)
tree1bf7e3a340e910756ddde22bd4b8bdb1b6429048 /lib/github/issues.rb
parent7030eb3286613be919e12daf95c43061b49aa5f5 (diff)
downloadgitlab-ce-fc42f3dffa364a360c76ff2785813d74f42016c7.tar.gz
Add basic client for the GitHub API
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