Class: Anchorman::GitHubRepo
- Inherits:
-
Object
- Object
- Anchorman::GitHubRepo
- Defined in:
- lib/anchorman/git_hub_repo.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #gfm_context ⇒ Object
-
#initialize(url) ⇒ GitHubRepo
constructor
A new instance of GitHubRepo.
Constructor Details
#initialize(url) ⇒ GitHubRepo
Returns a new instance of GitHubRepo.
7 8 9 10 11 |
# File 'lib/anchorman/git_hub_repo.rb', line 7 def initialize(url) md = url.match(/github\.com\/(.*)\/(.*)\.git/) @username = md[1] || '' @name = md[2] || '' end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/anchorman/git_hub_repo.rb', line 5 def name @name end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
4 5 6 |
# File 'lib/anchorman/git_hub_repo.rb', line 4 def username @username end |
Instance Method Details
#gfm_context ⇒ Object
13 14 15 |
# File 'lib/anchorman/git_hub_repo.rb', line 13 def gfm_context "#{username}/#{name}" end |