Class: Menu::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/menu/parser.rb

Overview

Parse user input

Class Method Summary collapse

Class Method Details

.parse_config_argumentsObject



23
24
25
# File 'lib/menu/parser.rb', line 23

def self.parse_config_arguments
  Menu::Config.new(Menu::Generator.make_config_menu)
end

.parse_main_argumentsObject

Parse command-line arguments for main menu



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/menu/parser.rb', line 10

def self.parse_main_arguments
  menu = Menu::Generator.make_main_menu
  extra_input = {
    config: menu[:config],
    scheduled: menu[:scheduled]
  }
  extra_procs = {
    config: proc { parse_config_arguments },
    scheduled: proc { parse_scheduled_arguments }
  }
  Menu::Main.new(menu, extra_input, extra_procs)
end

.parse_scheduled_argumentsObject



27
28
29
# File 'lib/menu/parser.rb', line 27

def self.parse_scheduled_arguments
  Menu::Scheduled.new(Menu::Generator.make_scheduled_menu)
end