Module: Starter::Names
- Included in:
- Builder
- Defined in:
- lib/starter/builder/names.rb
Instance Method Summary collapse
- #api_base_file_name ⇒ Object
-
#api_file_name ⇒ Object
resource file.
-
#api_spec_name ⇒ Object
resource spec.
- #base_file_name ⇒ Object
- #base_spec_name ⇒ Object
-
#entity_file_name ⇒ Object
resource file.
- #klass_name ⇒ Object
-
#lib_file_name ⇒ Object
lib file.
-
#lib_spec_name ⇒ Object
lib spec.
- #mount_point ⇒ Object
Instance Method Details
#api_base_file_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
10 11 12 |
# File 'lib/starter/builder/names.rb', line 10 def base_file_name @resource.tr('/', '-').downcase + '.rb' end |
#base_spec_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
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_name ⇒ Object
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_point ⇒ Object
18 19 20 |
# File 'lib/starter/builder/names.rb', line 18 def mount_point " mount Endpoints::#{klass_name}\n" end |