Class: Upfluence::Peer::Version::GitVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/upfluence/peer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commit:, remote: nil, branch: nil) ⇒ GitVersion

Returns a new instance of GitVersion.



46
47
48
49
50
# File 'lib/upfluence/peer.rb', line 46

def initialize(commit:, remote: nil, branch: nil)
  @commit = commit
  @remote = remote
  @branch = branch
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



44
45
46
# File 'lib/upfluence/peer.rb', line 44

def branch
  @branch
end

#commitObject (readonly)

Returns the value of attribute commit.



44
45
46
# File 'lib/upfluence/peer.rb', line 44

def commit
  @commit
end

#remoteObject (readonly)

Returns the value of attribute remote.



44
45
46
# File 'lib/upfluence/peer.rb', line 44

def remote
  @remote
end

Instance Method Details

#to_sObject



52
53
54
# File 'lib/upfluence/peer.rb', line 52

def to_s
  "v0.0.0+git-#{@commit[0..6]}"
end