Class: Archipelago::Generators::IslandGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Archipelago::Generators::IslandGenerator
- Defined in:
- lib/generators/archipelago/island/island_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_action_files ⇒ Object
17 18 19 20 21 22 |
# File 'lib/generators/archipelago/island/island_generator.rb', line 17 def create_action_files operations.each do |operation| @operation = operation template "action.rb.tt", File.join("app/islands", file_path, "#{operation}.rb") end end |
#create_component_file ⇒ Object
24 25 26 27 |
# File 'lib/generators/archipelago/island/island_generator.rb', line 24 def create_component_file @component_name = class_name template "component.tsx.tt", File.join("app/javascript/islands", "#{class_name}.tsx") end |
#ensure_operations ⇒ Object
13 14 15 |
# File 'lib/generators/archipelago/island/island_generator.rb', line 13 def ensure_operations raise ArgumentError, "At least one operation is required" if operations.empty? end |