Class: Survey::SurveyGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/survey/survey_generator.rb

Constant Summary collapse

TEMPLATES =
["active_admin", "rails_admin", "plain", "routes"]

Instance Method Summary collapse

Instance Method Details

#create_resolutionObject



13
14
15
16
17
18
19
20
21
# File 'lib/generators/survey/survey_generator.rb', line 13

def create_resolution
  strategy = arguments.first
  if TEMPLATES.include? strategy
    send("generate_#{strategy}_resolution")
    success_message(strategy)
  else
    error_message(strategy)
  end
end