Class: RDoc::RubyToken::TkVal

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, value = nil) ⇒ TkVal

Returns a new instance of TkVal.



114
115
116
117
# File 'lib/rdoc/ruby_token.rb', line 114

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

Instance Attribute Details

#valueObject Also known as: text

Returns the value of attribute value



118
119
120
# File 'lib/rdoc/ruby_token.rb', line 118

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



120
121
122
123
124
125
# File 'lib/rdoc/ruby_token.rb', line 120

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

#set_text(text) ⇒ Object



127
128
129
130
# File 'lib/rdoc/ruby_token.rb', line 127

def set_text text
  @value = text
  self
end