Class: Version::Token

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
brew/Library/Homebrew/version.rb

Direct Known Subclasses

NullToken, NumericToken, StringToken

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Token

Returns a new instance of Token



17
18
19
# File 'brew/Library/Homebrew/version.rb', line 17

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value



15
16
17
# File 'brew/Library/Homebrew/version.rb', line 15

def value
  @value
end

Instance Method Details

#inspectObject



21
22
23
# File 'brew/Library/Homebrew/version.rb', line 21

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

#numeric?Boolean

Returns:

  • (Boolean)


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

def numeric?
  false
end

#to_sObject



25
26
27
# File 'brew/Library/Homebrew/version.rb', line 25

def to_s
  value.to_s
end