Class: Gitwrap::Org
- Inherits:
-
GithubConnection
- Object
- GithubConnection
- Gitwrap::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.
Constructor Details
#initialize(hash) ⇒ Org
Returns a new instance of Org.
6 7 8 9 10 11 12 13 14 |
# File 'lib/gitwrap/orgs.rb', line 6 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.
3 4 5 |
# File 'lib/gitwrap/orgs.rb', line 3 def followers @followers end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/gitwrap/orgs.rb', line 3 def id @id end |
#location ⇒ Object
Returns the value of attribute location.
3 4 5 |
# File 'lib/gitwrap/orgs.rb', line 3 def location @location end |
#members ⇒ Object
Returns the value of attribute members.
3 4 5 |
# File 'lib/gitwrap/orgs.rb', line 3 def members @members end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/gitwrap/orgs.rb', line 3 def name @name end |
#public_repos ⇒ Object
Returns the value of attribute public_repos.
3 4 5 |
# File 'lib/gitwrap/orgs.rb', line 3 def public_repos @public_repos end |
#site ⇒ Object
Returns the value of attribute site.
3 4 5 |
# File 'lib/gitwrap/orgs.rb', line 3 def site @site end |
Class Method Details
.fetch_all_orgs ⇒ Object
20 21 22 23 24 |
# File 'lib/gitwrap/orgs.rb', line 20 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
16 17 18 |
# File 'lib/gitwrap/orgs.rb', line 16 def self.fetch_single_org(organization) org = Org.new({}).create_org("#{BASE_URL}orgs/#{organization}") end |