From fc42f3dffa364a360c76ff2785813d74f42016c7 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Tue, 11 Apr 2017 22:33:54 -0300 Subject: Add basic client for the GitHub API --- lib/github/user.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/github/user.rb (limited to 'lib/github/user.rb') diff --git a/lib/github/user.rb b/lib/github/user.rb new file mode 100644 index 00000000000..19fe6230820 --- /dev/null +++ b/lib/github/user.rb @@ -0,0 +1,23 @@ +module Github + class User + attr_reader :username + + def initialize(username) + @username = username + end + + def get + client.get(user_url).body + end + + private + + def client + @client ||= Github::Client.new + end + + def user_url + "/users/#{username}" + end + end +end -- cgit v1.2.1