Class: Hanami::CLI::Naming

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/cli/naming.rb

Overview

Since:

  • 2.0.0

Instance Method Summary collapse

Constructor Details

#initialize(inflector:) ⇒ Naming

Returns a new instance of Naming.

Since:

  • 2.0.0



8
9
10
# File 'lib/hanami/cli/naming.rb', line 8

def initialize(inflector:)
  @inflector = inflector
end

Instance Method Details

#action_name(name) ⇒ Object

Since:

  • 2.0.0



12
13
14
# File 'lib/hanami/cli/naming.rb', line 12

def action_name(name)
  inflector.underscore(escape(name)).gsub("/", ".")
end