Class: GithubSnapshot::Organization

Inherits:
Object
  • Object
show all
Defined in:
lib/github_snapshot/organization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, repos) ⇒ Organization

Returns a new instance of Organization.



9
10
11
12
# File 'lib/github_snapshot/organization.rb', line 9

def initialize(name, repos)
  @name   = name
  @repos  = repos
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/github_snapshot/organization.rb', line 7

def name
  @name
end

#reposObject (readonly)

Returns the value of attribute repos.



7
8
9
# File 'lib/github_snapshot/organization.rb', line 7

def repos
  @repos
end

Instance Method Details

#backupObject



14
15
16
17
18
19
20
# File 'lib/github_snapshot/organization.rb', line 14

def backup
  repos.to_a.each do |repo|
    GithubSnapshot.exec "mkdir -p #{name}"
    repository = Repository.new repo, self
    repository.backup
  end
end