Module: Rails::GraphQL::BaseGenerator
- Included in:
- GraphQL::Generators::ChannelGenerator, GraphQL::Generators::ControllerGenerator, GraphQL::Generators::InstallGenerator, GraphQL::Generators::SchemaGenerator
- Defined in:
- lib/rails/graphql/railties/base_generator.rb
Overview
GraphQL Base Generator
A module to help generators to operate
Constant Summary collapse
- TEMPALTES_PATH =
'../../../generators/graphql/templates'- APP_MODULE_NAME =
Rails.application.class.name.chomp('::Application')
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/rails/graphql/railties/base_generator.rb', line 12 def self.included(base) base.const_set(:APP_MODULE_NAME, APP_MODULE_NAME) base.send(:namespace, "graphql:#{base.name.demodulize.underscore[0..-11]}") base.send(:source_root, File.(TEMPALTES_PATH, __dir__)) base.send(:class_option, :directory, type: :string, default: 'app/graphql', desc: 'Directory where generated files should be saved', ) end |