version: convert to endless methods

This commit is contained in:
Georg Gadinger 2022-07-23 12:45:24 +02:00
parent a45446db0f
commit 73da030395
1 changed files with 8 additions and 24 deletions

View File

@ -13,36 +13,20 @@ module Retrospring
module Version
module_function
def year
2022
end
def year = 2022
def month
7
end
def month = 7
def day
23
end
def day = 23
def patch
0
end
def patch = 0
def suffix
""
end
def suffix = ""
def minor
[month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
end
def minor = [month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
def to_a
[year.to_s, minor, patch.to_s]
end
def to_a = [year.to_s, minor, patch.to_s]
def to_s
[to_a.join("."), suffix].join
end
def to_s = [to_a.join("."), suffix].join
end
end