Class: Charming::Generators::ComponentGenerator

Inherits:
AppFileGenerator show all
Defined in:
lib/charming/generators/component_generator.rb

Overview

ComponentGenerator implements ‘charming generate component NAME`. Writes a `Charming::Presentation::Component` subclass to `app/components/<name>_component.rb`.

Instance Method Summary collapse

Methods inherited from AppFileGenerator

#initialize

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Charming::Generators::AppFileGenerator

Instance Method Details

#generateObject

Writes the component file to the standard ‘app/components` path.



9
10
11
# File 'lib/charming/generators/component_generator.rb', line 9

def generate
  create_file(app_path("app", "components"), component)
end