Class: Org
- Inherits:
-
GithubConnection
- Object
- GithubConnection
- Org
- Defined in:
- lib/gitwrap/orgs.rb
Constant Summary
Constants inherited from GithubConnection
Instance Attribute Summary collapse
-
#followers ⇒ Object
Returns the value of attribute followers.
-
#id ⇒ Object
Returns the value of attribute id.
-
#location ⇒ Object
Returns the value of attribute location.
-
#members ⇒ Object
Returns the value of attribute members.
-
#name ⇒ Object
Returns the value of attribute name.
-
#public_repos ⇒ Object
Returns the value of attribute public_repos.
-
#site ⇒ Object
Returns the value of attribute site.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Org
constructor
A new instance of Org.
Methods included from DataCreator
#create_many_orgs, #create_many_repos, #create_many_users, #create_org, #create_org_repos, #create_single_repo, #create_user, #create_user_repos, #parse_data
Constructor Details
#initialize(hash) ⇒ Org
Returns a new instance of Org.
5 6 7 8 9 10 11 12 13 |
# File 'lib/gitwrap/orgs.rb', line 5 def initialize(hash) @id = hash["id"] @name = hash["login"] @site = hash["blog"] @location = hash["location"] @public_repos = hash["public_repos"] @followers = hash["followers"] @members = hash["members"] end |
Instance Attribute Details
#followers ⇒ Object
Returns the value of attribute followers.
2 3 4 |
# File 'lib/gitwrap/orgs.rb', line 2 def followers @followers end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/gitwrap/orgs.rb', line 2 def id @id end |
#location ⇒ Object
Returns the value of attribute location.
2 3 4 |
# File 'lib/gitwrap/orgs.rb', line 2 def location @location end |
#members ⇒ Object
Returns the value of attribute members.
2 3 4 |
# File 'lib/gitwrap/orgs.rb', line 2 def members @members end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/gitwrap/orgs.rb', line 2 def name @name end |
#public_repos ⇒ Object
Returns the value of attribute public_repos.
2 3 4 |
# File 'lib/gitwrap/orgs.rb', line 2 def public_repos @public_repos end |
#site ⇒ Object
Returns the value of attribute site.
2 3 4 |
# File 'lib/gitwrap/orgs.rb', line 2 def site @site end |
Class Method Details
.fetch_all_orgs ⇒ Object
19 20 21 22 23 |
# File 'lib/gitwrap/orgs.rb', line 19 def self.fetch_all_orgs orgs = Org.new({}).create_many_orgs("#{BASE_URL}organizations?since=#{$current_org}") $current_org += orgs.length-1 orgs end |
.fetch_single_org(organization) ⇒ Object
15 16 17 |
# File 'lib/gitwrap/orgs.rb', line 15 def self.fetch_single_org(organization) org = Org.new({}).create_org("#{BASE_URL}orgs/#{organization}") end |