Class: Hanami::CLI::Generators::App::RubyFileWriter Private

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

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

Since:

  • 2.2.0



17
18
19
20
# File 'lib/hanami/cli/generators/app/ruby_file_writer.rb', line 17

def initialize(fs:, inflector:)
  @fs = fs
  @inflector = inflector
end

Instance Method Details

#call(key:, namespace:, base_path:, relative_parent_class:, extra_namespace: nil, body: []) ⇒ 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



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/hanami/cli/generators/app/ruby_file_writer.rb', line 24

def call(key:, namespace:, base_path:, relative_parent_class:, extra_namespace: nil, body: [])
  ClassFile.new(
    fs: fs,
    inflector: inflector,
    key: key,
    namespace: namespace,
    base_path: base_path,
    relative_parent_class: relative_parent_class,
    extra_namespace: extra_namespace,
    body: body,
  ).write
end