class RailsNewApp::JavaScriptFrameworkScreen

Public Class Methods

default() click to toggle source
# File lib/rails-new-app/screens/java_script_framework_screen.rb, line 29
def self.default
  {
    option_number: 1,
    name: "None",
    key: "",
    in_rails_new: false
  }
end

Public Instance Methods

after_valid() click to toggle source
# File lib/rails-new-app/screens/java_script_framework_screen.rb, line 19
def after_valid
  puts "Selected framework is: #{option}\n"
end
lowercase_keys() click to toggle source
# File lib/rails-new-app/screens/java_script_framework_screen.rb, line 11
def lowercase_keys
  ["", "react", "vue", "angular", "elm", "stimulus"]
end
options() click to toggle source
# File lib/rails-new-app/screens/java_script_framework_screen.rb, line 7
def options
  ["None", "ReactJS", "VueJS", "Angular", "Elm", "Stimulus"]
end
rails_new_options() click to toggle source
# File lib/rails-new-app/screens/java_script_framework_screen.rb, line 3
def rails_new_options
  %W[react vue angular elm stimulus]
end
return_value() click to toggle source
Calls superclass method RailsNewApp::ChoiceScreen#return_value
# File lib/rails-new-app/screens/java_script_framework_screen.rb, line 23
def return_value
  super.tap do |h|
    h[:in_rails_new] = rails_new_options.include?(h[:key])
  end
end
step_question() click to toggle source
# File lib/rails-new-app/screens/java_script_framework_screen.rb, line 15
def step_question
  "Type the option number of the JavaScript framework to use:"
end