Class: RDoc::RubyToken::TkUnknownChar

Inherits:
Token
  • Object
show all
Defined in:
lib/rdoc/ruby_token.rb

Instance Attribute Summary collapse

Attributes inherited from Token

#char_no, #line_no, #seek

Instance Method Summary collapse

Constructor Details

#initialize(seek, line_no, char_no, name) ⇒ TkUnknownChar

Returns a new instance of TkUnknownChar.



216
217
218
219
# File 'lib/rdoc/ruby_token.rb', line 216

def initialize(seek, line_no, char_no, name)
  super(seek, line_no, char_no)
  @name = name
end

Instance Attribute Details

#nameObject (readonly) Also known as: text

Returns the value of attribute name



220
221
222
# File 'lib/rdoc/ruby_token.rb', line 220

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



222
223
224
225
226
227
# File 'lib/rdoc/ruby_token.rb', line 222

def ==(other)
  self.class == other.class and
  other.line_no == @line_no and
  other.char_no == @char_no and
  other.name == @name
end

#inspectObject

:nodoc:



236
237
238
239
# File 'lib/rdoc/ruby_token.rb', line 236

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



229
230
231
232
# File 'lib/rdoc/ruby_token.rb', line 229

def set_text text
  @name = text
  self
end