Class: TDPUtils::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/tdp/utils.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, value) ⇒ Token

Returns a new instance of Token.



6
7
8
9
# File 'lib/tdp/utils.rb', line 6

def initialize(kind, value)
  @kind = kind
  @value = value
end

Instance Attribute Details

#kindObject

Returns the value of attribute kind.



5
6
7
# File 'lib/tdp/utils.rb', line 5

def kind
  @kind
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/tdp/utils.rb', line 5

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
14
15
# File 'lib/tdp/utils.rb', line 11

def ==(other)
  (other.class == self.class) &&
  (@kind == other.kind) &&
  (@value == other.value)
end

#===(other) ⇒ Object



17
18
19
# File 'lib/tdp/utils.rb', line 17

def ===(other)
  super(other) || (@kind == other)
end

#=~(other) ⇒ Object



21
22
23
# File 'lib/tdp/utils.rb', line 21

def =~(other)
  @kind == other
end