Class: RDoc::RubyToken::TkOPASGN

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

Instance Attribute Summary collapse

Attributes inherited from TkOp

#name

Attributes inherited from Token

#char_no, #line_no, #seek

Instance Method Summary collapse

Methods inherited from TkOp

#set_text

Methods inherited from Token

#set_text

Constructor Details

#initialize(seek, line_no, char_no, op) ⇒ TkOPASGN

Returns a new instance of TkOPASGN.



188
189
190
191
192
193
# File 'lib/rdoc/ruby_token.rb', line 188

def initialize(seek, line_no, char_no, op)
  super(seek, line_no, char_no)
  op = TkReading2Token[op][0] unless op.kind_of?(Symbol)
  @op = op
  @text = nil
end

Instance Attribute Details

#opObject (readonly)

Returns the value of attribute op



195
196
197
# File 'lib/rdoc/ruby_token.rb', line 195

def op
  @op
end

Instance Method Details

#==(other) ⇒ Object



197
198
199
200
201
202
# File 'lib/rdoc/ruby_token.rb', line 197

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

#inspectObject

:nodoc:



208
209
210
211
# File 'lib/rdoc/ruby_token.rb', line 208

def inspect # :nodoc:
  klass = self.class.name.split('::').last
  "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @op]
end

#textObject



204
205
206
# File 'lib/rdoc/ruby_token.rb', line 204

def text
  @text ||= "#{TkToken2Reading[op]}="
end