54 |
54 |
|
55 |
55 |
include Comparable
|
56 |
56 |
|
57 |
|
attr_reader :mejor, :minor, :debug, :devel
|
|
57 |
attr_reader :major, :minor, :debug, :devel
|
58 |
58 |
|
59 |
|
def initialize(mejor, minor, debug, devel=0)
|
60 |
|
@mejor = mejor
|
|
59 |
def initialize(major, minor, debug, devel=0)
|
|
60 |
@major = major
|
61 |
61 |
@minor = minor
|
62 |
62 |
@debug = debug
|
63 |
63 |
@devel = devel
|
64 |
64 |
end
|
65 |
65 |
|
66 |
66 |
def to_a
|
67 |
|
[@mejor, @minor, @debug, @devel]
|
|
67 |
[@major, @minor, @debug, @devel]
|
68 |
68 |
end
|
69 |
69 |
|
70 |
70 |
def to_s
|
71 |
71 |
case @devel
|
72 |
72 |
when OUT
|
73 |
|
[@mejor, @minor, @debug].join('.')
|
|
73 |
[@major, @minor, @debug].join('.')
|
74 |
74 |
when ALPHA
|
75 |
|
[@mejor, @minor, @debug].join('.') + "-alpha#{@devel}"
|
|
75 |
[@major, @minor, @debug].join('.') + "-alpha#{@devel}"
|
76 |
76 |
when DEVELOP
|
77 |
|
[@mejor, @minor, @debug].join('.') + "-develop"
|
|
77 |
[@major, @minor, @debug].join('.') + "-develop"
|
78 |
78 |
end
|
79 |
79 |
end
|
80 |
80 |
|
81 |
81 |
def to_i
|
82 |
|
@mejor
|
|
82 |
@major
|
83 |
83 |
end
|
84 |
84 |
|
85 |
85 |
def to_f
|
86 |
|
@mejor + @minor/100
|
|
86 |
@major + @minor/100
|
87 |
87 |
end
|
88 |
88 |
|
89 |
89 |
def inspect
|