Class: Librarian::Manifest::Version

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/librarian/manifest.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Version

Returns a new instance of Version


9
10
11
12
13
# File 'lib/librarian/manifest.rb', line 9

def initialize(*args)
  args = initialize_normalize_args(args)

  self.backing = Gem::Version.new(*args)
end

Instance Method Details

#<=>(other) ⇒ Object


19
20
21
# File 'lib/librarian/manifest.rb', line 19

def <=>(other)
  to_gem_version <=> other.to_gem_version
end

#inspectObject


27
28
29
# File 'lib/librarian/manifest.rb', line 27

def inspect
  "#<#{self.class} #{to_s}>"
end

#to_gem_versionObject


15
16
17
# File 'lib/librarian/manifest.rb', line 15

def to_gem_version
  backing
end

#to_sObject


23
24
25
# File 'lib/librarian/manifest.rb', line 23

def to_s
  to_gem_version.to_s
end