Module: RailsServices::Fileable

Included in:
Generators::CreateGenerator, Generators::DestroyGenerator, Generators::FormGenerator
Defined in:
lib/rails_services/fileable.rb

Overview

handles creating files and directories

Instance Method Summary collapse

Instance Method Details

#form_object_fileObject

forms



25
26
27
# File 'lib/rails_services/fileable.rb', line 25

def form_object_file
  "#{object_name.underscore}_form.rb"
end

#form_spec_fileObject



29
30
31
# File 'lib/rails_services/fileable.rb', line 29

def form_spec_file
  "#{object_name.underscore}_form_spec.rb"
end

#form_unit_fileObject



33
34
35
# File 'lib/rails_services/fileable.rb', line 33

def form_unit_file
  "#{object_name.underscore}_form_test.rb"
end

#object_directoryObject



5
6
7
8
9
# File 'lib/rails_services/fileable.rb', line 5

def object_directory
  file_path = parent_name.pluralize.underscore.to_s
  file_path += "/#{options['sub_folder'].underscore}" if options['sub_folder'].present?
  file_path
end

#service_object_fileObject

services



12
13
14
# File 'lib/rails_services/fileable.rb', line 12

def service_object_file
  "#{object_name.underscore}.rb"
end

#service_spec_fileObject



16
17
18
# File 'lib/rails_services/fileable.rb', line 16

def service_spec_file
  "#{object_name.underscore}_spec.rb"
end

#service_unit_fileObject



20
21
22
# File 'lib/rails_services/fileable.rb', line 20

def service_unit_file
  "#{object_name.underscore}_test.rb"
end