Class: ActionBlocks::Generators::TypeGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- ActionBlocks::Generators::TypeGenerator
- Includes:
- ActionBlocks::GeneratorHelper, Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/active_blocks/type/type_generator.rb,
lib/action_blocks/generators/action_blocks/type/type_generator.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#sub_blocks ⇒ Object
Returns the value of attribute sub_blocks.
Instance Method Summary collapse
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
7 8 9 |
# File 'lib/generators/active_blocks/type/type_generator.rb', line 7 def fields @fields end |
#sub_blocks ⇒ Object
Returns the value of attribute sub_blocks.
7 8 9 |
# File 'lib/generators/active_blocks/type/type_generator.rb', line 7 def sub_blocks @sub_blocks end |
Instance Method Details
#view_templates ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/generators/active_blocks/type/type_generator.rb', line 15 def view_templates # @struct_methods = ask("Struct Methods: (e.g. title)").split() # @builder_methods = ask("Builder Methods: (e.g. string_field, float_field)").split() @fields = [:fields] @builds = [:builds] template "dsl.rb", "lib/action_blocks/#{variable}_builder.rb" template "controller.rb", "app/controllers/#{variable}_blocks_controller.rb" template "type.css", "client/src/ActionBlocks/#{class_name}/#{class_name}.css" template "type.js", "client/src/ActionBlocks/#{class_name}/#{class_name}.js" end |