Method: YARD::CodeObjects::MethodObject#name

Defined in:
lib/yard/code_objects/method_object.rb

#name(prefix = false) ⇒ String, Symbol

Returns the name of the object.

Examples:

The name of an instance method (with prefix)

an_instance_method.name(true) # => "#mymethod"

The name of a class method (with prefix)

a_class_method.name(true) # => "mymethod"

Parameters:

  • prefix (Boolean) (defaults to: false)

    whether or not to show the prefix

Returns:

  • (String)

    returns #sep + name for an instance method if prefix is true

  • (Symbol)

    the name without #sep if prefix is set to false



175
176
177
# File 'lib/yard/code_objects/method_object.rb', line 175

def name(prefix = false)
  prefix ? (sep == ISEP ? "#{sep}#{super}" : super.to_s) : super
end