Class: Gitwrap::Org
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Gitwrap::Org
- Includes:
- HTTParty
- Defined in:
- lib/gitwrap/orgs.rb
Class Method Summary collapse
Class Method Details
.fetch_all_orgs(org_id) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/gitwrap/orgs.rb', line 15 def self.fetch_all_orgs(org_id) response = get("/organizations?since=#{org_id}&per_page=100") if response.success? response = response.parsed_response response.each { |org| $orgs << new(org)} $orgs else raise_exception(response.code, response.body) end end |
.fetch_single_org(organization) ⇒ Object
10 11 12 13 |
# File 'lib/gitwrap/orgs.rb', line 10 def self.fetch_single_org(organization) response = get("/orgs/#{organization}") if response.success? then org = new(response) else raise_exception(response.code, response.body) end end |