Class: Version::AlphaToken

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

Constant Summary collapse

PATTERN =
/alpha[0-9]*|a[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



102
103
104
105
106
107
108
109
110
111
# File 'Library/Homebrew/version.rb', line 102

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