Class: Duty::Meta::Humanizer

Inherits:
Object
  • Object
show all
Defined in:
lib/duty/meta/humanizer.rb

Instance Method Summary collapse

Instance Method Details

#task(klass) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/duty/meta/humanizer.rb', line 6

def task(klass)
  klass.to_s.
    gsub(/([A-Z])/, '-\1').
    split('-').
    reject(&:empty?).
    map(&:downcase).
    join('-').
    split('::').
    last.
    gsub(/^-/,'')
end