BigW Consortium Gitlab

user.rb 362 Bytes
Newer Older
1 2
module Github
  class User
3
    attr_reader :username, :options
4

5
    def initialize(username, options)
6
      @username = username
7
      @options  = options
8 9 10 11 12 13 14 15 16
    end

    def get
      client.get(user_url).body
    end

    private

    def client
17
      @client ||= Github::Client.new(options)
18 19 20 21 22 23 24
    end

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