Class: StashCloneTool::StashRepository

Inherits:
Object
  • Object
show all
Includes:
StashCloneTool
Defined in:
lib/stash_clone_tool/stash_repository.rb

Constant Summary

Constants included from StashCloneTool

VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, repo) ⇒ StashRepository

Returns a new instance of StashRepository.



7
8
9
10
11
12
# File 'lib/stash_clone_tool/stash_repository.rb', line 7

def initialize(project, repo)
  @name = repo['name']
  @clone_links = repo['links']['clone'].map{ |link| CloneLink.new(link)}
  @slug = repo['slug']
  @project = project
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/stash_clone_tool/stash_repository.rb', line 5

def name
  @name
end

#projectObject (readonly)

Returns the value of attribute project.



5
6
7
# File 'lib/stash_clone_tool/stash_repository.rb', line 5

def project
  @project
end

#slugObject (readonly)

Returns the value of attribute slug.



5
6
7
# File 'lib/stash_clone_tool/stash_repository.rb', line 5

def slug
  @slug
end

Instance Method Details



14
15
16
17
# File 'lib/stash_clone_tool/stash_repository.rb', line 14

def clone_link(type)
  cl = @clone_links.select { |link| link.type == type }.first
  cl.uri
end