Class: KStarter::Questions::Rails

Inherits:
BaseQuestion show all
Defined in:
lib/k_starter/questions/rails.rb

Overview

Ask code generations for a new GEM.

Instance Attribute Summary collapse

Attributes inherited from BaseQuestion

#actor, #description, #github_key, #klue_template_active, #klue_template_name, #name, #problem, #root_path, #solution, #story_active, #sub_path, #type, #user_story, #variant

Instance Method Summary collapse

Methods inherited from BaseQuestion

#ask_actor, #ask_description, #ask_github_key, #ask_klue_template_active?, #ask_klue_template_name, #ask_problem, #ask_root_path, #ask_solution, #ask_story_active?, #ask_sub_path, #ask_user_story, #default_klue_template_active, #default_questions, #default_story_active, #infer_klue_template_name, #klue_template_questions, #question, #show_story, #story_questions

Methods included from TtyHelpers

#command, #config, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which

Constructor Details

#initialize(**args) ⇒ Rails

Returns a new instance of Rails.



16
17
18
19
# File 'lib/k_starter/questions/rails.rb', line 16

def initialize(**args)
  args = { type: 'rails' }.merge(args)
  super(**args)
end

Instance Attribute Details

#include_action_textObject (readonly)

Returns the value of attribute include_action_text.



7
8
9
# File 'lib/k_starter/questions/rails.rb', line 7

def include_action_text
  @include_action_text
end

#include_active_storageObject (readonly)

Returns the value of attribute include_active_storage.



8
9
10
# File 'lib/k_starter/questions/rails.rb', line 8

def include_active_storage
  @include_active_storage
end

#include_common_pagesObject (readonly)

Returns the value of attribute include_common_pages.



13
14
15
# File 'lib/k_starter/questions/rails.rb', line 13

def include_common_pages
  @include_common_pages
end

#include_deviseObject (readonly)

Returns the value of attribute include_devise.



11
12
13
# File 'lib/k_starter/questions/rails.rb', line 11

def include_devise
  @include_devise
end

#include_javascript_librariesObject (readonly)

Returns the value of attribute include_javascript_libraries.



10
11
12
# File 'lib/k_starter/questions/rails.rb', line 10

def include_javascript_libraries
  @include_javascript_libraries
end

#include_rspecObject (readonly)

Returns the value of attribute include_rspec.



12
13
14
# File 'lib/k_starter/questions/rails.rb', line 12

def include_rspec
  @include_rspec
end

#include_sample_modelsObject (readonly)

Returns the value of attribute include_sample_models.



9
10
11
# File 'lib/k_starter/questions/rails.rb', line 9

def include_sample_models
  @include_sample_models
end

#run_db_migrateObject (readonly)

Returns the value of attribute run_db_migrate.



14
15
16
# File 'lib/k_starter/questions/rails.rb', line 14

def run_db_migrate
  @run_db_migrate
end

Instance Method Details

#ask_questionsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/k_starter/questions/rails.rb', line 21

def ask_questions
  ask_name
  ask_root_path
  ask_github_key
  ask_description
  story_questions
  klue_template_questions

  ask_include_action_text
  ask_include_active_storage
  ask_include_sample_models
  ask_include_javascript_libraries
  ask_include_devise
  ask_include_rspec
  ask_include_common_pages
  ask_run_db_migrate
end

#to_domObject



54
55
56
# File 'lib/k_starter/questions/rails.rb', line 54

def to_dom
  KStarter::Schema::RailsProject.new(to_h)
end

#to_hObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/k_starter/questions/rails.rb', line 39

def to_h
  super.merge(
    {
      include_action_text: include_action_text,
      include_active_storage: include_active_storage,
      include_sample_models: include_sample_models,
      include_javascript_libraries: include_javascript_libraries,
      include_devise: include_devise,
      include_rspec: include_rspec,
      include_common_pages: include_common_pages,
      run_db_migrate: run_db_migrate
    }
  )
end