Class: ROM::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/rom/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.namespaceObject



6
7
8
# File 'lib/generators/rom/install_generator.rb', line 6

def self.namespace
  "rom:#{generator_name}"
end

.source_rootObject



10
11
12
# File 'lib/generators/rom/install_generator.rb', line 10

def self.source_root
  File.expand_path('install/templates', __dir__)
end

Instance Method Details

#add_application_modelObject



28
29
30
# File 'lib/generators/rom/install_generator.rb', line 28

def add_application_model
  copy_file "application_model.rb", "app/models/application_model.rb"
end

#add_types_moduleObject



24
25
26
# File 'lib/generators/rom/install_generator.rb', line 24

def add_types_module
  copy_file "types.rb", "lib/types.rb"
end

#create_initializerObject



19
20
21
22
# File 'lib/generators/rom/install_generator.rb', line 19

def create_initializer
  template 'initializer.rb.erb',
    File.join('config', 'initializers', 'rom.rb')
end