Class: ServiceGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/generators/service_generator.rb

Overview

Service Generator Class.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject

Defines the templates path.



14
15
16
# File 'lib/generators/service_generator.rb', line 14

def self.source_root
  File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#generateObject

Responsible to generate the named service inside lib/services path of working directory.



23
24
25
# File 'lib/generators/service_generator.rb', line 23

def generate
  template('service.tt', "lib/services/#{name.underscore}_service.rb")
end