Class: ROM::Generators::Base

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

Class Method Summary collapse

Class Method Details

.base_nameObject



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

def self.base_name
  'rom'
end

.default_adapterObject



26
27
28
# File 'lib/generators/rom.rb', line 26

def self.default_adapter
  (default_gateway && default_gateway.adapter)
end

.default_gatewayObject



22
23
24
# File 'lib/generators/rom.rb', line 22

def self.default_gateway
  ROM.env.gateways[:default]
end

.namespaceObject



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

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

.source_rootObject



15
16
17
18
19
20
# File 'lib/generators/rom.rb', line 15

def self.source_root
  File.expand_path(
    "../#{base_name}/#{generator_name}/templates",
    __FILE__
  )
end