Class: RailsNewApp::FormBuilderScreen

Inherits:
ChoiceScreen show all
Defined in:
lib/rails-new-app/screens/form_builder_screen.rb

Instance Attribute Summary

Attributes inherited from Screen

#config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ChoiceScreen

#clean_input, #option, #return_value, #screen_text, #valid?

Methods inherited from Screen

#clean_input, clean_name, #initialize, key, #next_step, #process_user_input, #return_value, #screen_text, #valid?, #validate_user_input

Constructor Details

This class inherits a constructor from RailsNewApp::Screen

Class Method Details

.defaultObject



19
20
21
22
23
24
25
# File 'lib/rails-new-app/screens/form_builder_screen.rb', line 19

def self.default
  {
    option_number: 1,
    name: "None",
    key: ""
  }
end

Instance Method Details

#after_validObject



15
16
17
# File 'lib/rails-new-app/screens/form_builder_screen.rb', line 15

def after_valid
  puts "Selected Form builder is: #{option}\n"
end

#lowercase_keysObject



11
12
13
# File 'lib/rails-new-app/screens/form_builder_screen.rb', line 11

def lowercase_keys
  ["", "simple_form", "formtastic"]
end

#optionsObject



7
8
9
# File 'lib/rails-new-app/screens/form_builder_screen.rb', line 7

def options
  ["None", "Simple Form", "Formtastic"]
end

#step_questionObject



3
4
5
# File 'lib/rails-new-app/screens/form_builder_screen.rb', line 3

def step_question
  "Type the option number of the Form Builder gem to use:"
end