Class: TDPUtils::Token
- Inherits:
-
Object
- Object
- TDPUtils::Token
- Defined in:
- lib/tdp/utils.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #===(other) ⇒ Object
- #=~(other) ⇒ Object
-
#initialize(kind, value) ⇒ Token
constructor
A new instance of Token.
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
#kind ⇒ Object
Returns the value of attribute kind.
5 6 7 |
# File 'lib/tdp/utils.rb', line 5 def kind @kind end |
#value ⇒ Object
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 |