summaryrefslogtreecommitdiff
path: root/lib/github/user.rb
blob: f88a29e590b04a528516609f69592e756d642078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Github
  class User
    attr_reader :username, :options

    def initialize(username, options)
      @username = username
      @options  = options
    end

    def get
      client.get(user_url).body
    end

    private

    def client
      @client ||= Github::Client.new(options)
    end

    def user_url
      "/users/#{username}"
    end
  end
end