Class: Processor::Subroutine::Name

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/processor/subroutine/name.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/processor/subroutine/name.rb', line 6

def name
  return super if __getobj__.respond_to? :name

  # underscore a class name
 @name ||= real_object.class.name.to_s.
    gsub(/::/, '_').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    downcase
end