Class: RDoc::RubyToken::TkOp
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
(also: #text)
Returns the value of attribute name.
Attributes inherited from Token
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(seek, line_no, char_no, name = nil) ⇒ TkOp
constructor
A new instance of TkOp.
-
#inspect ⇒ Object
:nodoc:.
- #set_text(text) ⇒ Object
Constructor Details
#initialize(seek, line_no, char_no, name = nil) ⇒ TkOp
Returns a new instance of TkOp.
159 160 161 162 |
# File 'lib/rdoc/ruby_token.rb', line 159 def initialize(seek, line_no, char_no, name = nil) super seek, line_no, char_no @name = name end |
Instance Attribute Details
#name ⇒ Object Also known as: text
Returns the value of attribute name.
164 165 166 |
# File 'lib/rdoc/ruby_token.rb', line 164 def name @name end |
Instance Method Details
#==(other) ⇒ Object
166 167 168 169 170 171 |
# File 'lib/rdoc/ruby_token.rb', line 166 def ==(other) self.class == other.class and other.line_no == @line_no and other.char_no == @char_no and other.name == @name end |
#inspect ⇒ Object
:nodoc:
180 181 182 183 |
# File 'lib/rdoc/ruby_token.rb', line 180 def inspect # :nodoc: klass = self.class.name.split('::').last "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @name] end |
#set_text(text) ⇒ Object
173 174 175 176 |
# File 'lib/rdoc/ruby_token.rb', line 173 def set_text text @name = text self end |