Class: Shaddox::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/shaddox/repo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info) ⇒ Repo

Returns a new instance of Repo.



4
5
6
7
8
9
10
# File 'lib/shaddox/repo.rb', line 4

def initialize(info)
  @info = info
  @url = info[:url]
  @branch = info[:branch] || 'master'
  @vcs = info[:vcs] || :git
  @shared = [info[:shared]].flatten || []
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



3
4
5
# File 'lib/shaddox/repo.rb', line 3

def branch
  @branch
end

#sharedObject (readonly)

Returns the value of attribute shared.



3
4
5
# File 'lib/shaddox/repo.rb', line 3

def shared
  @shared
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/shaddox/repo.rb', line 3

def url
  @url
end

#vcsObject (readonly)

Returns the value of attribute vcs.



3
4
5
# File 'lib/shaddox/repo.rb', line 3

def vcs
  @vcs
end

Instance Method Details

#to_sourceObject



12
13
14
# File 'lib/shaddox/repo.rb', line 12

def to_source
  "Shaddox::Repo.new(#{@info.inspect})"
end