Class: Scro::Auth::User

Inherits:
Request show all
Defined in:
lib/scro/auth/user.rb

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, )
  super(token)
  @login = 
end

Instance Attribute Details

#user_jsonObject (readonly)

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

#infoObject



31
32
33
# File 'lib/scro/auth/user.rb', line 31

def info
  @info ||= get("user/show/#{@login}")["user"]
end

#pushable_reposObject



27
28
29
# File 'lib/scro/auth/user.rb', line 27

def pushable_repos
  @pushable_repos ||= get("repos/pushable")["repositories"]
end

#reposObject



19
20
21
# File 'lib/scro/auth/user.rb', line 19

def repos
  @repos ||= get("repos/show/#{@login}")["repositories"]
end

#ssh_keysObject



15
16
17
# File 'lib/scro/auth/user.rb', line 15

def ssh_keys
  @ssh_keys ||= get("user/keys")["public_keys"]
end

#watched_reposObject



23
24
25
# File 'lib/scro/auth/user.rb', line 23

def watched_repos
  @watched_repos ||= get("repos/watched/#{@login}")["repositories"]
end