Class: Rails::Generators::ClaptonGenerator

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/rails/generators/clapton_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_component_fileObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rails/generators/clapton_generator.rb', line 6

def create_component_file
  create_file "app/components/#{file_name}_component.rb" do
    "    class \#{class_name}Component < Clapton::Component\n      def render\n      end\n    end\n    RUBY\n  end\n\n  create_file \"app/states/\#{file_name}_state.rb\" do\n    <<~RUBY\n    class \#{class_name}State < Clapton::State\n    end\n    RUBY\n  end\nend\n"