Class: YARD::Parser::Ruby::ParameterNode

Inherits:
AstNode show all
Defined in:
lib/yard/parser/ruby/ast_node.rb

Managing node state collapse

Constructor Details

This class inherits a constructor from YARD::Parser::Ruby::AstNode

Instance Method Details

#block_paramObject



382
# File 'lib/yard/parser/ruby/ast_node.rb', line 382

def block_param; self[-1] ? self[-1][0] : nil end

#optional_paramsObject



383
384
385
386
387
388
389
# File 'lib/yard/parser/ruby/ast_node.rb', line 383

def optional_params
  optional = self[1]
  if self[-2] && self[-2][0] && self[-2][0].type == :default_arg
    optional += self[-2]
  end
  optional
end

#required_end_paramsObject



380
# File 'lib/yard/parser/ruby/ast_node.rb', line 380

def required_end_params; self[3] end

#required_paramsObject



379
# File 'lib/yard/parser/ruby/ast_node.rb', line 379

def required_params; self[0] end

#splat_paramObject



381
# File 'lib/yard/parser/ruby/ast_node.rb', line 381

def splat_param; self[2] ? self[2][0] : nil end