Class: Method

Inherits:
Object show all
Defined in:
lib/nrser/core_ext/method/full_name.rb

Instance Method Summary collapse

Instance Method Details

#full_nameObject Also known as: to_summary

Returns the method’s #receiver and #name in the common ‘A.cls_meth` / `A#inst_meth` format.



9
10
11
12
13
14
15
16
# File 'lib/nrser/core_ext/method/full_name.rb', line 9

def full_name
  case receiver
  when Module
    "#{ receiver.safe_name }.#{ name }"
  else
    "#{ receiver.class.safe_name }##{ name }"
  end
end