Class: Motion::Generators::ComponentGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/motion/component_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_componentObject



12
13
14
# File 'lib/generators/motion/component_generator.rb', line 12

def generate_component
  generate "component", class_name, *attributes.map(&:name)
end

#include_motionObject



16
17
18
19
20
# File 'lib/generators/motion/component_generator.rb', line 16

def include_motion
  inject_into_class component_path, "#{class_name}Component" do
    "  include Motion::Component\n\n"
  end
end