# Class: YARD::Parser::Ruby::Legacy::RubyParser

Inherits:
  Base
  - Object
  - Base
  - YARD::Parser::Ruby::Legacy::RubyParser
  show all

Defined in:
  lib/yard/parser/ruby/legacy/ruby_parser.rb

## Overview

Legacy Ruby parser

Since:

- 0.5.6

## Instance Method Summary collapse

- #encoding_line ⇒ Object
- #enumerator ⇒ Object
- #initialize(source, _filename) ⇒ RubyParser constructor

  A new instance of RubyParser.

- #parse ⇒ Object
- #shebang_line ⇒ Object
- #tokenize ⇒ Object

## Constructor Details

### #initialize(source, _filename) ⇒ `RubyParser`

Returns a new instance of RubyParser.

Since:

- 0.5.6

    9
    10
    11

    # File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 9

    def initialize(source, _filename)
      @source = source
    end

## Instance Method Details

### #encoding_line ⇒ `Object`

Since:

- 0.5.6

    26

    # File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 26

    def encoding_line; @parse.encoding_line end

### #enumerator ⇒ `Object`

Since:

- 0.5.6

    22
    23
    24

    # File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 22

    def enumerator
      @parse
    end

### #parse ⇒ `Object`

Since:

- 0.5.6

    13
    14
    15
    16

    # File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 13

    def parse
      @parse ||= StatementList.new(@source)
      self
    end

### #shebang_line ⇒ `Object`

Since:

- 0.5.6

    27

    # File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 27

    def shebang_line; @parse.shebang_line end

### #tokenize ⇒ `Object`

Since:

- 0.5.6

    18
    19
    20

    # File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 18

    def tokenize
      @tokenize ||= TokenList.new(@source)
    end