Class: Mofa::CmdLineArgs
- Inherits:
-
Object
- Object
- Mofa::CmdLineArgs
- Defined in:
- lib/mofa/cmd_line_args.rb
Class Method Summary collapse
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize ⇒ CmdLineArgs
constructor
A new instance of CmdLineArgs.
- #list ⇒ Object
- #register(cmd_line_args) ⇒ Object
Constructor Details
#initialize ⇒ CmdLineArgs
Returns a new instance of CmdLineArgs.
7 8 9 |
# File 'lib/mofa/cmd_line_args.rb', line 7 def initialize @cmd_line_args = {} end |
Class Method Details
.instance ⇒ Object
3 4 5 |
# File 'lib/mofa/cmd_line_args.rb', line 3 def self.instance @__instance__ ||= new end |
Instance Method Details
#get(key) ⇒ Object
15 16 17 18 |
# File 'lib/mofa/cmd_line_args.rb', line 15 def get(key) raise "Cmd Line Arg with key #{key} does not exist!" unless @cmd_line_args.key?(key) @cmd_line_args[key] end |
#list ⇒ Object
20 21 22 23 |
# File 'lib/mofa/cmd_line_args.rb', line 20 def list puts 'Comman Line Args:' @cmd_line_args.inspect end |
#register(cmd_line_args) ⇒ Object
11 12 13 |
# File 'lib/mofa/cmd_line_args.rb', line 11 def register(cmd_line_args) @cmd_line_args = cmd_line_args end |