Module: Starter::Names

Included in:
Builder
Defined in:
lib/starter/builder/names.rb

Instance Method Summary collapse

Instance Method Details

#api_base_file_nameObject



22
23
24
# File 'lib/starter/builder/names.rb', line 22

def api_base_file_name
  File.join(Dir.getwd, 'api', 'base.rb')
end

#api_file_nameObject

resource file



27
28
29
# File 'lib/starter/builder/names.rb', line 27

def api_file_name
  File.join(Dir.getwd, 'api', 'endpoints', base_file_name)
end

#api_spec_nameObject

resource spec



42
43
44
# File 'lib/starter/builder/names.rb', line 42

def api_spec_name
  File.join(Dir.getwd, 'spec', 'requests', base_spec_name)
end

#base_file_nameObject



10
11
12
# File 'lib/starter/builder/names.rb', line 10

def base_file_name
  @resource.tr('/', '-').downcase + '.rb'
end

#base_spec_nameObject



14
15
16
# File 'lib/starter/builder/names.rb', line 14

def base_spec_name
  base_file_name.gsub(/.rb$/, '_spec.rb')
end

#entity_file_nameObject

resource file



32
33
34
# File 'lib/starter/builder/names.rb', line 32

def entity_file_name
  File.join(Dir.getwd, 'api', 'entities', base_file_name)
end

#klass_nameObject



5
6
7
8
# File 'lib/starter/builder/names.rb', line 5

def klass_name
  for_klass = prepare_klass
  singular? ? for_klass.classify : for_klass.classify.pluralize
end

#lib_file_nameObject

lib file



37
38
39
# File 'lib/starter/builder/names.rb', line 37

def lib_file_name
  File.join(Dir.getwd, 'lib', 'api', base_file_name)
end

#lib_spec_nameObject

lib spec



47
48
49
# File 'lib/starter/builder/names.rb', line 47

def lib_spec_name
  File.join(Dir.getwd, 'spec', 'lib', 'api', base_spec_name)
end

#mount_pointObject



18
19
20
# File 'lib/starter/builder/names.rb', line 18

def mount_point
  "    mount Endpoints::#{klass_name}\n"
end