Class: YARD::Parser::Ruby::MethodDefinitionNode

Inherits:
AstNode
  • Object
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

#def?Boolean

Returns:

  • (Boolean)


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

def def?; true end

#kw?Boolean

Returns:

  • (Boolean)


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

def kw?; true end

#method_name(name_only = false) ⇒ Object



476
477
478
479
# File 'lib/yard/parser/ruby/ast_node.rb', line 476

def method_name(name_only = false)
  name = self[index_adjust]
  name_only ? name.jump(:ident).first.to_sym : name
end

#namespaceObject



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

def namespace; first if index_adjust > 0 end

#parameters(include_block_param = true) ⇒ Object



481
482
483
484
485
# File 'lib/yard/parser/ruby/ast_node.rb', line 481

def parameters(include_block_param = true)
  params = self[1 + index_adjust]
  params = params[0] if params.type == :paren
  include_block_param ? params : params[0...-1]
end