Class: Toycol::Command
- Inherits:
-
Object
- Object
- Toycol::Command
- Defined in:
- lib/toycol/command.rb
Defined Under Namespace
Classes: Options
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(argv) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(argv) ⇒ Command
Returns a new instance of Command.
133 134 135 |
# File 'lib/toycol/command.rb', line 133 def initialize(argv) @argv = argv end |
Class Method Details
.run(argv) ⇒ Object
129 130 131 |
# File 'lib/toycol/command.rb', line 129 def self.run(argv) new(argv).execute end |
Instance Method Details
#execute ⇒ Object
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/toycol/command.rb', line 137 def execute = Options.parse!(@argv) command = .delete(:command) case command when "client", "c" Client.execute!([:request_message]) when "server", "s" ARGV.push("-q", "-s", "toycol") Rack::Server.start when "generate", "g" type = [:template_type] || "all" TemplateGenerator.generate!(type: type, name: [:protocol_name]) end end |