Class: Version::PreToken

Inherits:
CompositeToken show all
Defined in:
Library/Homebrew/version.rb

Constant Summary collapse

PATTERN =
/pre[0-9]*/i

Instance Attribute Summary

Attributes inherited from Token

#value

Instance Method Summary collapse

Methods inherited from CompositeToken

#rev

Methods inherited from StringToken

#initialize

Methods inherited from Token

#initialize, #inspect, #numeric?, #to_s

Constructor Details

This class inherits a constructor from Version::StringToken

Instance Method Details

#<=>(other) ⇒ Object



134
135
136
137
138
139
140
141
142
143
144
145
# File 'Library/Homebrew/version.rb', line 134

def <=>(other)
  case other
  when PreToken
    rev <=> other.rev
  when AlphaToken, BetaToken
    1
  when RCToken, PatchToken
    -1
  else
    super
  end
end