gitlab-org--gitlab-foss/lib/github/user.rb

25 lines
362 B
Ruby
Raw Normal View History

2017-04-12 01:33:54 +00:00
module Github
class User
2017-04-19 23:04:58 +00:00
attr_reader :username, :options
2017-04-12 01:33:54 +00:00
2017-04-19 23:04:58 +00:00
def initialize(username, options)
2017-04-12 01:33:54 +00:00
@username = username
2017-04-19 23:04:58 +00:00
@options = options
2017-04-12 01:33:54 +00:00
end
def get
client.get(user_url).body
end
private
def client
2017-04-19 23:04:58 +00:00
@client ||= Github::Client.new(options)
2017-04-12 01:33:54 +00:00
end
def user_url
"/users/#{username}"
end
end
end