Class: Lapidarist::GemVersion
- Inherits:
-
Object
- Object
- Lapidarist::GemVersion
- Defined in:
- lib/lapidarist/gem_version.rb
Instance Attribute Summary collapse
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #==(other_version) ⇒ Object
-
#initialize(version:, sha: nil) ⇒ GemVersion
constructor
A new instance of GemVersion.
- #to_s ⇒ Object
Constructor Details
#initialize(version:, sha: nil) ⇒ GemVersion
5 6 7 8 |
# File 'lib/lapidarist/gem_version.rb', line 5 def initialize(version:, sha: nil) @version = version @sha = sha end |
Instance Attribute Details
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
3 4 5 |
# File 'lib/lapidarist/gem_version.rb', line 3 def sha @sha end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/lapidarist/gem_version.rb', line 3 def version @version end |
Instance Method Details
#==(other_version) ⇒ Object
10 11 12 13 |
# File 'lib/lapidarist/gem_version.rb', line 10 def ==(other_version) version == other_version.version && sha == other_version.sha end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/lapidarist/gem_version.rb', line 15 def to_s [version, sha].compact.join(' ') end |