Class: Mofa::CmdLineArgs

Inherits:
Object
  • Object
show all
Defined in:
lib/mofa/cmd_line_args.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCmdLineArgs

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

.instanceObject



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

#listObject



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