lib/versionaire/version.rb in versionaire-9.1.0 vs lib/versionaire/version.rb in versionaire-9.1.1

- old
+ new

@@ -7,13 +7,11 @@ Version = Struct.new :major, :minor, :patch, keyword_init: true do include Comparable using Refinements::Structs - def self.delimiter - "." - end + def self.delimiter = "." def self.pattern / \A( # Start of string and OR. \d* # Major only. @@ -52,20 +50,14 @@ def <=> other to_s <=> other.to_s end - def down key, value = 1 - revalue(key => value) { |previous, current| previous - current } - end + def down(key, value = 1) = revalue(key => value) { |previous, current| previous - current } - def up key, value = 1 - revalue(key => value) { |previous, current| previous + current } - end + def up(key, value = 1) = revalue(key => value) { |previous, current| previous + current } - def to_s - to_a.join self.class.delimiter - end + def to_s = to_a.join(self.class.delimiter) alias_method :to_str, :to_s alias_method :values, :to_a private