Class: RDoc::RubyToken::Token
- Inherits:
 - 
      Object
      
        
- Object
 - RDoc::RubyToken::Token
 
 
- Defined in:
 - lib/rdoc/ruby_token.rb
 
Instance Attribute Summary collapse
- 
  
    
      #char_no  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute char_no.
 - 
  
    
      #line_no  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute line_no.
 - 
  
    
      #seek  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute seek.
 - 
  
    
      #text  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute text.
 
Instance Method Summary collapse
- #==(other) ⇒ Object
 - 
  
    
      #initialize(seek, line_no, char_no, text = nil)  ⇒ Token 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Token.
 - 
  
    
      #inspect  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
:nodoc:.
 - 
  
    
      #set_text(text)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Because we’re used in contexts that expect to return a token, we set the text string and then return ourselves.
 
Constructor Details
#initialize(seek, line_no, char_no, text = nil) ⇒ Token
Returns a new instance of Token.
      35 36 37 38 39 40  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 35 def initialize(seek, line_no, char_no, text = nil) @seek = seek @line_no = line_no @char_no = char_no @text = text end  | 
  
Instance Attribute Details
#char_no ⇒ Object (readonly)
Returns the value of attribute char_no.
      44 45 46  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 44 def char_no @char_no end  | 
  
#line_no ⇒ Object (readonly)
Returns the value of attribute line_no.
      43 44 45  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 43 def line_no @line_no end  | 
  
#seek ⇒ Object (readonly)
Returns the value of attribute seek.
      42 43 44  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 42 def seek @seek end  | 
  
#text ⇒ Object
Returns the value of attribute text.
      46 47 48  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 46 def text @text end  | 
  
Instance Method Details
#==(other) ⇒ Object
      48 49 50 51 52 53  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 48 def ==(other) self.class == other.class and other.line_no == @line_no and other.char_no == @char_no and other.text == @text end  | 
  
#inspect ⇒ Object
:nodoc:
      64 65 66 67  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 64 def inspect # :nodoc: klass = self.class.name.split('::').last "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @text] end  | 
  
#set_text(text) ⇒ Object
Because we’re used in contexts that expect to return a token, we set the text string and then return ourselves
      59 60 61 62  | 
    
      # File 'lib/rdoc/ruby_token.rb', line 59 def set_text(text) @text = text self end  |