Class: RDocRuboCop::Lang::Ruby::Token
- Inherits:
-
Object
- Object
- RDocRuboCop::Lang::Ruby::Token
- Defined in:
- lib/rdoc_rubocop/lang/ruby/token.rb,
lib/rdoc_rubocop/lang/ruby/token/comment_token.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CommentToken
Instance Attribute Summary collapse
-
#locate ⇒ Object
readonly
Returns the value of attribute locate.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #column ⇒ Object
-
#initialize(locate, type, token, state) ⇒ Token
constructor
A new instance of Token.
- #lineno ⇒ Object
Constructor Details
#initialize(locate, type, token, state) ⇒ Token
Returns a new instance of Token.
16 17 18 19 20 21 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 16 def initialize(locate, type, token, state) @locate = locate @type = type @token = token @state = state end |
Instance Attribute Details
#locate ⇒ Object (readonly)
Returns the value of attribute locate.
5 6 7 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 5 def locate @locate end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
5 6 7 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 5 def state @state end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
5 6 7 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 5 def token @token end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 5 def type @type end |
Class Method Details
.build(locate, type, token, state) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 7 def self.build(locate, type, token, state) case type when :on_comment CommentToken.new(locate, type, token, state) else new(locate, type, token, state) end end |
Instance Method Details
#column ⇒ Object
27 28 29 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 27 def column @locate[1] end |
#lineno ⇒ Object
23 24 25 |
# File 'lib/rdoc_rubocop/lang/ruby/token.rb', line 23 def lineno @locate[0] end |