Class: Version::PreToken

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

Constant Summary collapse

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

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



140
141
142
143
144
145
146
147
148
149
150
151
# File 'brew/Library/Homebrew/version.rb', line 140

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