Class: Hanami::CLI::Generators::App::Component Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/cli/generators/app/component.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.

Since:

  • 2.2.0

Instance Method Summary collapse

Constructor Details

#initialize(fs:, inflector:, out: $stdout) ⇒ Component

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 Component.

Since:

  • 2.2.0



15
16
17
18
19
# File 'lib/hanami/cli/generators/app/component.rb', line 15

def initialize(fs:, inflector:, out: $stdout)
  @fs = fs
  @inflector = inflector
  @out = out
end

Instance Method Details

#call(key:, namespace:, base_path:) ⇒ 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.

Since:

  • 2.2.0



23
24
25
26
27
28
29
30
31
# File 'lib/hanami/cli/generators/app/component.rb', line 23

def call(key:, namespace:, base_path:)
  RubyClassFile.new(
    fs: fs,
    inflector: inflector,
    key: key,
    namespace: namespace,
    base_path: base_path,
  ).create
end