Class: CMSScanner::ParsedCli
- Inherits:
-
Object
- Object
- CMSScanner::ParsedCli
- Defined in:
- lib/cms_scanner/parsed_cli.rb
Overview
Class to hold the parsed CLI options and have them available via methods, such as #verbose?, rather than from the hash. This is similar to an OpenStruct, but class wise (rather than instance), and with the logic to update the Browser options accordinly
Class Method Summary collapse
-
.method_missing(method_name, *_args, &_block) ⇒ Object
Unknown methods will return nil, this is the expected behaviour rubocop:disable Style/MissingRespondToMissing.
- .options ⇒ Hash
-
.options=(options) ⇒ Object
Sets the CLI options, and put them into the Browser as well.
- .verbose? ⇒ Boolean
Class Method Details
.method_missing(method_name, *_args, &_block) ⇒ Object
Unknown methods will return nil, this is the expected behaviour rubocop:disable Style/MissingRespondToMissing
30 31 32 33 34 |
# File 'lib/cms_scanner/parsed_cli.rb', line 30 def self.method_missing(method_name, *_args, &_block) super if method_name == :new [method_name.to_sym] end |
.options ⇒ Hash
10 11 12 |
# File 'lib/cms_scanner/parsed_cli.rb', line 10 def self. @options ||= {} end |
.options=(options) ⇒ Object
Sets the CLI options, and put them into the Browser as well
16 17 18 19 20 21 |
# File 'lib/cms_scanner/parsed_cli.rb', line 16 def self.() @options = .dup || {} NS::Browser.reset NS::Browser.instance(@options) end |
.verbose? ⇒ Boolean
24 25 26 |
# File 'lib/cms_scanner/parsed_cli.rb', line 24 def self.verbose? [:verbose] ? true : false end |