Class: WPScan::ParsedCli
- Inherits:
-
Object
- Object
- WPScan::ParsedCli
- Defined in:
- lib/wpscan/parsed_cli.rb
Overview
Holds the parsed CLI options and exposes them via class methods (e.g. #verbose?) rather than from the raw hash. Similar to an OpenStruct but class-wise, with extra logic to push browser-relevant options into the Browser singleton.
Class Method Summary collapse
-
.method_missing(method_name, *_args) ⇒ Object
Unknown methods return nil — expected behaviour for option lookups.
- .options ⇒ Hash
-
.options=(options) ⇒ Object
Sets the CLI options and propagates them to the Browser.
- .verbose? ⇒ Boolean
Class Method Details
.method_missing(method_name, *_args) ⇒ Object
Unknown methods return nil — expected behaviour for option lookups. rubocop:disable Style/MissingRespondToMissing
29 30 31 32 33 |
# File 'lib/wpscan/parsed_cli.rb', line 29 def self.method_missing(method_name, *_args, &) super if method_name == :new [method_name.to_sym] end |
.options ⇒ Hash
9 10 11 |
# File 'lib/wpscan/parsed_cli.rb', line 9 def self. @options ||= {} end |
.options=(options) ⇒ Object
Sets the CLI options and propagates them to the Browser.
15 16 17 18 19 20 |
# File 'lib/wpscan/parsed_cli.rb', line 15 def self.() @options = .dup || {} WPScan::Browser.reset WPScan::Browser.instance(@options) end |
.verbose? ⇒ Boolean
23 24 25 |
# File 'lib/wpscan/parsed_cli.rb', line 23 def self.verbose? [:verbose] ? true : false end |