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 Version
module_function module_function
def year def year = 2022
2022
end
def month def month = 7
7
end
def day def day = 23
23
end
def patch def patch = 0
0
end
def suffix def suffix = ""
""
end
def minor def minor = [month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
[month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
end
def to_a def to_a = [year.to_s, minor, patch.to_s]
[year.to_s, minor, patch.to_s]
end
def to_s def to_s = [to_a.join("."), suffix].join
[to_a.join("."), suffix].join
end
end end
end end