Class: Upfluence::Peer::Version

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

Defined Under Namespace

Classes: GitVersion, SemanticVersion

Constant Summary collapse

DEFAULT_VERSION =
'v0.0.0-dirty'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(git, semantic) ⇒ Version

Returns a new instance of Version.



61
62
63
64
# File 'lib/upfluence/peer.rb', line 61

def initialize(git, semantic)
  @git = git
  @semantic = semantic
end

Instance Attribute Details

#gitObject (readonly)

Returns the value of attribute git.



59
60
61
# File 'lib/upfluence/peer.rb', line 59

def git
  @git
end

#semanticObject (readonly)

Returns the value of attribute semantic.



59
60
61
# File 'lib/upfluence/peer.rb', line 59

def semantic
  @semantic
end

Instance Method Details

#to_sObject



66
67
68
69
70
71
# File 'lib/upfluence/peer.rb', line 66

def to_s
  return @semantic.to_s if @semantic
  return @git.to_s if @git

  DEFAULT_VERSION
end