Class: Anchorman::GitHubRepo

Inherits:
Object
  • Object
show all
Defined in:
lib/anchorman/git_hub_repo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/anchorman/git_hub_repo.rb', line 5

def name
  @name
end

#usernameObject (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_contextObject



13
14
15
# File 'lib/anchorman/git_hub_repo.rb', line 13

def gfm_context
  "#{username}/#{name}"
end