Class: Version::NullToken

Inherits:
Token
  • Object
show all
Defined in:
Library/Homebrew/version.rb

Instance Attribute Summary

Attributes inherited from Token

#value

Instance Method Summary collapse

Methods inherited from Token

#numeric?, #to_s

Constructor Details

#initialize(value = nil) ⇒ NullToken



29
30
31
# File 'Library/Homebrew/version.rb', line 29

def initialize(value = nil)
  super
end

Instance Method Details

#<=>(other) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
# File 'Library/Homebrew/version.rb', line 33

def <=>(other)
  case other
  when NullToken
    0
  when NumericToken
    other.value.zero? ? 0 : -1
  when AlphaToken, BetaToken, PreToken, RCToken
    1
  else
    -1
  end
end

#inspectObject



46
47
48
# File 'Library/Homebrew/version.rb', line 46

def inspect
  "#<#{self.class.name}>"
end