Class: GithubControl::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/github-control/repository.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, name, access) ⇒ Repository

Returns a new instance of Repository.



5
6
7
# File 'lib/github-control/repository.rb', line 5

def initialize(owner, name, access)
  @owner, @name, @access = owner, name, access
end

Instance Attribute Details

#accessObject (readonly)

Returns the value of attribute access.



3
4
5
# File 'lib/github-control/repository.rb', line 3

def access
  @access
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/github-control/repository.rb', line 3

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



3
4
5
# File 'lib/github-control/repository.rb', line 3

def owner
  @owner
end

Instance Method Details

#collaboratorsObject



21
22
23
# File 'lib/github-control/repository.rb', line 21

def collaborators
  @collaborators ||= Collaborators.new(self)
end

#destroyObject



29
30
31
# File 'lib/github-control/repository.rb', line 29

def destroy
  @owner.repositories.delete(@name)
end

#full_nameObject



17
18
19
# File 'lib/github-control/repository.rb', line 17

def full_name
  "#{@owner.name}/#{@name}"
end

#post_receive_urlsObject



25
26
27
# File 'lib/github-control/repository.rb', line 25

def post_receive_urls
  @post_receive_urls ||= PostReceiveUrls.new(self)
end

#private?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/github-control/repository.rb', line 9

def private?
  @access == :private
end

#public?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/github-control/repository.rb', line 13

def public?
  @access == :public
end