Class: Hanami::CLI::Commands::Templates Private
- Inherits:
-
Object
- Object
- Hanami::CLI::Commands::Templates
- Defined in:
- lib/hanami/cli/commands/templates.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- NAMESPACE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
name.sub(Utils::String.demodulize(name), "").freeze
Instance Method Summary collapse
- #find(*names) ⇒ Object private
-
#initialize(klass) ⇒ Templates
constructor
private
A new instance of Templates.
Constructor Details
#initialize(klass) ⇒ Templates
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Templates.
11 12 13 14 15 |
# File 'lib/hanami/cli/commands/templates.rb', line 11 def initialize(klass) word = klass.name.sub(NAMESPACE, "").split("::").map(&:downcase) @root = Pathname.new(File.join(__dir__, *word)) freeze end |
Instance Method Details
#find(*names) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/hanami/cli/commands/templates.rb', line 19 def find(*names) @root.join(*names) end |