Class: YARD::Rustdoc::DefParser

Inherits:
Object
  • Object
show all
Defined in:
lib/yard-rustdoc/def_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ DefParser

Returns a new instance of DefParser.



16
17
18
19
20
21
# File 'lib/yard-rustdoc/def_parser.rb', line 16

def initialize(string)
  @string = string
  @name = nil
  @parameters = []
  parse!
end

Instance Attribute Details

#nameObject (readonly)

The name of the def‘d method



9
10
11
# File 'lib/yard-rustdoc/def_parser.rb', line 9

def name
  @name
end

#parametersArray<[String, [String, nil]]> (readonly)

The params of the def‘d method

Returns:

  • (Array<[String, [String, nil]]>)

    An array of tuple where 0 is the name of the arg with its specifier (&, **, :) and 1 is the default.



14
15
16
# File 'lib/yard-rustdoc/def_parser.rb', line 14

def parameters
  @parameters
end