Class: Centra::Rule::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/centra/rule/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, argv: ARGV) ⇒ CLI

Returns a new instance of CLI.



11
12
13
14
15
16
# File 'lib/centra/rule/cli.rb', line 11

def initialize(name:, argv: ARGV)
  @name = name
  @options = {}
  @optparser = nil
  parse_options(argv, @name, @options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/centra/rule/cli.rb', line 9

def options
  @options
end

Instance Method Details

#helpObject



18
19
20
# File 'lib/centra/rule/cli.rb', line 18

def help
  @optparser.help
end