Class: PaperPlaneGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- PaperPlaneGenerator
- Defined in:
- lib/generators/paper_plane_generator.rb
Constant Summary collapse
- TEMPLATE_ROUTES =
{ email: 'md', sms: 'text' }.freeze
Instance Method Summary collapse
Instance Method Details
#create_paper_plane_file ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/generators/paper_plane_generator.rb', line 11 def create_paper_plane_file template('paper_plane.rb', File.join('app/paper_planes', class_path, "#{file_name}_paper_plane.rb")) .each do || I18n.available_locales.each do |locale| flight_routes.each do |route_name, route_extension| template( "#{route_name}", File.join( 'app/paper_planes', class_path, file_name, , "#{route_name}.#{locale}.#{route_extension}.erb" ) ) end end end end |
#flight_routes ⇒ Object
32 33 34 |
# File 'lib/generators/paper_plane_generator.rb', line 32 def flight_routes TEMPLATE_ROUTES.except(*[:skip_routes]) end |