class CMSScanner::ParsedCli
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
Public Class Methods
method_missing(method_name, *_args, &_block)
click to toggle source
Unknown methods will return nil, this is the expected behaviour rubocop:disable Style/MissingRespondToMissing
Calls superclass method
# File lib/cms_scanner/parsed_cli.rb, line 30 def self.method_missing(method_name, *_args, &_block) super if method_name == :new options[method_name.to_sym] end
options()
click to toggle source
@return [ Hash ]
# File lib/cms_scanner/parsed_cli.rb, line 10 def self.options @options ||= {} end
options=(options)
click to toggle source
Sets the CLI options, and put them into the Browser
as well @param [ Hash ] options
# File lib/cms_scanner/parsed_cli.rb, line 16 def self.options=(options) @options = options.dup || {} NS::Browser.reset NS::Browser.instance(@options) end
verbose?()
click to toggle source
@return [ Boolean ]
# File lib/cms_scanner/parsed_cli.rb, line 24 def self.verbose? options[:verbose] ? true : false end