Class: RDoc::RubyToken::TkNode

Inherits:
Token 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

- (TkNode) initialize(seek, line_no, char_no, node = nil)

A new instance of TkNode



66
67
68
69
# File 'lib/rdoc/ruby_token.rb', line 66

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

Instance Attribute Details

- (Object) node (readonly) Also known as: text

Returns the value of attribute node



71
72
73
# File 'lib/rdoc/ruby_token.rb', line 71

def node
  @node
end

Instance Method Details

- (Object) ==(other)



73
74
75
76
77
78
# File 'lib/rdoc/ruby_token.rb', line 73

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

- (Object) set_text(text)



80
81
82
83
# File 'lib/rdoc/ruby_token.rb', line 80

def set_text text
  @node = text
  self
end