Class: Mddb::Generators::Molecule
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Mddb::Generators::Molecule
- Includes:
- Thor::Actions
- Defined in:
- lib/mddb/generators/molecule.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/mddb/generators/molecule.rb', line 8 def self.source_root File.('../../templates', __FILE__) end |
Instance Method Details
#molecule ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/mddb/generators/molecule.rb', line 12 def molecule template "molecule.rb.tt", "models/molecules/#{name}.rb" inject_into_class "models/frame.rb", Frame do " many :#{name.pluralize}, :class_name => '#{name.capitalize}'\n" end template "spec/molecule_spec.rb.tt", "spec/molecules/#{name}_spec.rb" end |