Class: Octokitty

Inherits:
Object
  • Object
show all
Defined in:
lib/reclone/octokitty.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOctokitty

Returns a new instance of Octokitty.



5
6
7
# File 'lib/reclone/octokitty.rb', line 5

def initialize
  @client = Octokit::Client.new(access_token: ENV["GIT_PAT"], auto_traversal: true, per_page: 100)
end

Instance Attribute Details

#clientObject (readonly)

! Do I need this class?



3
4
5
# File 'lib/reclone/octokitty.rb', line 3

def client
  @client
end

#repo_callObject (readonly)

! Do I need this class?



3
4
5
# File 'lib/reclone/octokitty.rb', line 3

def repo_call
  @repo_call
end

Instance Method Details

#repo_config(user) ⇒ Object



18
19
20
# File 'lib/reclone/octokitty.rb', line 18

def repo_config(user)
  @client.repos(user, {sort: "created", direction: "desc"})
end

#user_config(user_name) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/reclone/octokitty.rb', line 9

def user_config(user_name)
  begin  
    user = @client.user(user_name)
  rescue  
    user = nil 
  end 
  user
end