Class: StashCloneTool::StashRepository
- Inherits:
-
Object
- Object
- StashCloneTool::StashRepository
- Includes:
- StashCloneTool
- Defined in:
- lib/stash_clone_tool/stash_repository.rb
Constant Summary
Constants included from StashCloneTool
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Instance Method Summary collapse
- #clone_link(type) ⇒ Object
-
#initialize(project, repo) ⇒ StashRepository
constructor
A new instance of StashRepository.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/stash_clone_tool/stash_repository.rb', line 5 def name @name end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
5 6 7 |
# File 'lib/stash_clone_tool/stash_repository.rb', line 5 def project @project end |
#slug ⇒ Object (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
#clone_link(type) ⇒ Object
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 |