Class: Hyper::Component
- Inherits:
-
Rails::Generators::Base
- Object
- Thor::Group
- Rails::Generators::Base
- Hyper::Component
- Defined in:
- lib/generators/hyper/component_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_component_file ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/generators/hyper/component_generator.rb', line 7 def create_component_file self.components.each do |component| component_array = component.split('::') @modules = component_array[0..-2] @file_name = component_array.last @indent = 0 template 'component_template.rb', File.join('app/hyperloop/components', @modules.map(&:downcase).join('/'), "#{@file_name.underscore}.rb") end end |