Class: Version::Token

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
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



11
12
13
# File 'Library/Homebrew/version.rb', line 11

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value



9
10
11
# File 'Library/Homebrew/version.rb', line 9

def value
  @value
end

Instance Method Details

#inspectObject



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

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

#numeric?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'Library/Homebrew/version.rb', line 23

def numeric?
  false
end

#to_sObject



19
20
21
# File 'Library/Homebrew/version.rb', line 19

def to_s
  value.to_s
end