lib/versionaire/version.rb in versionaire-5.0.0 vs lib/versionaire/version.rb in versionaire-5.1.0
- old
+ new
@@ -37,17 +37,20 @@
@maintenance = maintenance
validate
end
def + other
- self.class.new self.class.arguments(*reduce(other, :+))
+ klass = self.class
+ klass.new klass.arguments(*reduce(other, :+))
end
def - other
- self.class.new self.class.arguments(*reduce(other, :-))
+ klass = self.class
+ klass.new klass.arguments(*reduce(other, :-))
end
+ # :reek:FeatureEnvy
def == other
other.is_a?(Version) && to_s == other.to_s
end
alias eql? ==
@@ -57,15 +60,11 @@
def hash
[major, minor, maintenance, self.class].hash
end
- def label
- "v#{self}"
- end
-
def to_s
- "#{major}#{self.class.delimiter}#{minor}#{self.class.delimiter}#{maintenance}"
+ [major, minor, maintenance].join self.class.delimiter
end
alias to_str to_s
def to_a
[major, minor, maintenance]