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.
160 161 162 163 |
# File 'lib/rdoc/ruby_token.rb', line 160 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
165 166 167 |
# File 'lib/rdoc/ruby_token.rb', line 165 def name @name end |
Instance Method Details
#==(other) ⇒ Object
167 168 169 170 171 172 |
# File 'lib/rdoc/ruby_token.rb', line 167 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:
181 182 183 184 |
# File 'lib/rdoc/ruby_token.rb', line 181 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
174 175 176 177 |
# File 'lib/rdoc/ruby_token.rb', line 174 def set_text text @name = text self end |