Class: RubyCop::Ruby::Token

Inherits:
Node
  • Object
show all
Defined in:
lib/ruby_cop/ruby/tokens.rb

Direct Known Subclasses

Char, Float, Identifier, Integer, Keyword, Label, Symbol

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#accept

Constructor Details

#initialize(token, position) ⇒ Token

Returns a new instance of Token.



4
5
6
7
# File 'lib/ruby_cop/ruby/tokens.rb', line 4

def initialize(token, position)
  @token    = token
  @position = position
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



10
11
12
# File 'lib/ruby_cop/ruby/tokens.rb', line 10

def position
  @position
end

#tokenObject (readonly)

Returns the value of attribute token.



9
10
11
# File 'lib/ruby_cop/ruby/tokens.rb', line 9

def token
  @token
end