Class: GitHub::Organization

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/github-api-client/organization.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get(login) ⇒ Object



14
15
16
17
# File 'lib/github-api-client/organization.rb', line 14

def self.get()
  o   = GitHub::Organization.()
  o ||= GitHub::Organization.new(:login => ).get
end

Instance Method Details

#fetch(*things) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/github-api-client/organization.rb', line 19

def fetch(*things)
  things.each do |thing|
    case thing
      when :self then get
      when :members then get_members
      when :repositories then get_repositories
    end
  end
  self
end

#getObject



6
7
8
9
10
11
12
# File 'lib/github-api-client/organization.rb', line 6

def get
  self.update_attributes(
    GitHub::Base.parse_attributes(:org_get,
      YAML::load(
        GitHub::Browser.get("/organizations/#{self.}"))['organization']))
  self
end