Class: Siba::Console

Inherits:
Object
  • Object
show all
Includes:
FilePlug
Defined in:
lib/siba/console.rb

Constant Summary collapse

UNUSED_COMMAND =

unused command for testing command line options

"unused"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FilePlug

#siba_file, siba_file, siba_file=

Constructor Details

#initialize(test_mode = false) ⇒ Console

Returns a new instance of Console.



14
15
16
17
# File 'lib/siba/console.rb', line 14

def initialize(test_mode=false)
  @test_mode = test_mode
  @options = {}
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



12
13
14
# File 'lib/siba/console.rb', line 12

def options
  @options
end

#parserObject

Returns the value of attribute parser.



12
13
14
# File 'lib/siba/console.rb', line 12

def parser
  @parser
end

#test_modeObject

Returns the value of attribute test_mode.



12
13
14
# File 'lib/siba/console.rb', line 12

def test_mode
  @test_mode
end

Instance Method Details

#parse(argv) ⇒ Object



19
20
21
22
23
# File 'lib/siba/console.rb', line 19

def parse(argv)
  @parser = parse_options argv
  return if parser.nil?
  parse_command argv
end