Class: Gemathon::List

Inherits:
Object
  • Object
show all
Defined in:
lib/gemathon/list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, org_name, options = {}) ⇒ List

Returns a new instance of List.



7
8
9
10
# File 'lib/gemathon/list.rb', line 7

def initialize connection, org_name,options = {}
  @org_name = org_name
  @connection = connection 
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



6
7
8
# File 'lib/gemathon/list.rb', line 6

def connection
  @connection
end

#org_nameObject (readonly)

Returns the value of attribute org_name.



6
7
8
# File 'lib/gemathon/list.rb', line 6

def org_name
  @org_name
end

Instance Method Details

#listObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/gemathon/list.rb', line 12

def list
  @list_repos=[]
  hsh_details= {}
  @org_name.each do |org_name|
  @list_repos=@connection.repos.list(auto_pagination: true,user:org_name)
    @list_repos.map(&:name).each do |repo|
      repo_details=@connection.repos.get(org_name,repo)
      hsh_details[repo]={:description=>repo_details["description"],:url=>repo_details["html_url"],:language=>repo_details["language"]}
    end
  end
 hsh_details
end