Class: Scro::Auth::User
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Request
#endpoint, #get, #post, #uri_for
Constructor Details
#initialize(token, login) ⇒ User
Returns a new instance of User.
6
7
8
9
|
# File 'lib/scro/auth/user.rb', line 6
def initialize(token, login)
super(token)
@login = login
end
|
Instance Attribute Details
#user_json ⇒ Object
Returns the value of attribute user_json.
4
5
6
|
# File 'lib/scro/auth/user.rb', line 4
def user_json
@user_json
end
|
Instance Method Details
#[](key) ⇒ Object
11
12
13
|
# File 'lib/scro/auth/user.rb', line 11
def [](key)
info[key]
end
|
#info ⇒ Object
31
32
33
|
# File 'lib/scro/auth/user.rb', line 31
def info
@info ||= get("user/show/#{@login}")["user"]
end
|
#pushable_repos ⇒ Object
27
28
29
|
# File 'lib/scro/auth/user.rb', line 27
def pushable_repos
@pushable_repos ||= get("repos/pushable")["repositories"]
end
|
#repos ⇒ Object
19
20
21
|
# File 'lib/scro/auth/user.rb', line 19
def repos
@repos ||= get("repos/show/#{@login}")["repositories"]
end
|
#ssh_keys ⇒ Object
15
16
17
|
# File 'lib/scro/auth/user.rb', line 15
def ssh_keys
@ssh_keys ||= get("user/keys")["public_keys"]
end
|
#watched_repos ⇒ Object
23
24
25
|
# File 'lib/scro/auth/user.rb', line 23
def watched_repos
@watched_repos ||= get("repos/watched/#{@login}")["repositories"]
end
|