Class: RailsInteractive::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_interactive.rb,
lib/cli/utils.rb,
lib/cli/prompt.rb,
lib/cli/command.rb,
lib/cli/message.rb,
lib/cli/version.rb,
lib/cli/category.rb,
lib/cli/command_handler.rb

Overview

CLI class for the interactive CLI module

Defined Under Namespace

Classes: Category, Command, CommandHandler, Message, Prompt, Utils

Constant Summary collapse

VERSION =
"2.1.3"

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



13
14
15
16
17
18
# File 'lib/rails_interactive.rb', line 13

def initialize
  @inputs = {}
  @commands = Command.new
  @categories = Category.new
  @handler = CommandHandler.new
end

Instance Method Details

#perform(key) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rails_interactive.rb', line 20

def perform(key)
  case key
  when "new"
    Message.greet
    initialize_project
  when "help"
    Message.help
  else
    puts "Invalid parameter"
  end
end