Class: AgileNotifier::SCM

Inherits:
Object
  • Object
show all
Defined in:
lib/agile_notifier/scm.rb

Direct Known Subclasses

Git, Github

Defined Under Namespace

Classes: Repository

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, args = {}) ⇒ SCM

Returns a new instance of SCM.



5
6
7
8
9
# File 'lib/agile_notifier/scm.rb', line 5

def initialize(url, args = {})
  @url = url
  @repositories = []
  @args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



3
4
5
# File 'lib/agile_notifier/scm.rb', line 3

def args
  @args
end

#repositoriesObject

Returns the value of attribute repositories.



3
4
5
# File 'lib/agile_notifier/scm.rb', line 3

def repositories
  @repositories
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/agile_notifier/scm.rb', line 3

def url
  @url
end

Instance Method Details

#add_repository(repository) ⇒ Object



11
12
13
# File 'lib/agile_notifier/scm.rb', line 11

def add_repository(repository)
  @repositories.push(repository)
end

#repositoryObject



15
16
17
18
19
20
21
# File 'lib/agile_notifier/scm.rb', line 15

def repository
  if @repositories.size == 1
    return @repositories.first
  else
    raise('There are more than one repository, please use method [repositories] instead of [repository]')
  end
end