Class: CMSScanner::Controller::Base
- Inherits:
-
Object
- Object
- CMSScanner::Controller::Base
- Includes:
- OptParseValidator
- Defined in:
- lib/cms_scanner/controller.rb
Overview
Base Controller
Direct Known Subclasses
Class Method Summary collapse
-
.parsed_options=(options) ⇒ Object
Set the parsed options and initialize the browser with them.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #after_scan ⇒ Object
- #before_scan ⇒ Object
- #cli_options ⇒ Array<OptParseValidator::OptBase>
- #datastore ⇒ Hash
- #formatter ⇒ Formatter::Base
- #output(tpl, vars = {}) ⇒ Void
- #parsed_options ⇒ Hash
- #render(tpl, vars = {}) ⇒ String
- #run ⇒ Object
- #target ⇒ Target
- #user_interaction? ⇒ Boolean
Class Method Details
.parsed_options=(options) ⇒ Object
Set the parsed options and initialize the browser with them
29 30 31 32 33 |
# File 'lib/cms_scanner/controller.rb', line 29 def self.() @@parsed_options = NS::Browser.instance() end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/cms_scanner/controller.rb', line 16 def ==(other) self.class == other.class end |
#after_scan ⇒ Object
14 |
# File 'lib/cms_scanner/controller.rb', line 14 def after_scan; end |
#before_scan ⇒ Object
10 |
# File 'lib/cms_scanner/controller.rb', line 10 def before_scan; end |
#cli_options ⇒ Array<OptParseValidator::OptBase>
8 |
# File 'lib/cms_scanner/controller.rb', line 8 def ; end |
#datastore ⇒ Hash
41 42 43 |
# File 'lib/cms_scanner/controller.rb', line 41 def datastore @@datastore ||= {} end |
#formatter ⇒ Formatter::Base
46 47 48 |
# File 'lib/cms_scanner/controller.rb', line 46 def formatter @@formatter ||= NS::Formatter.load([:format], datastore[:views]) end |
#output(tpl, vars = {}) ⇒ Void
53 54 55 |
# File 'lib/cms_scanner/controller.rb', line 53 def output(tpl, vars = {}) formatter.output(*tpl_params(tpl, vars)) end |
#parsed_options ⇒ Hash
36 37 38 |
# File 'lib/cms_scanner/controller.rb', line 36 def @@parsed_options ||= {} end |
#render(tpl, vars = {}) ⇒ String
60 61 62 |
# File 'lib/cms_scanner/controller.rb', line 60 def render(tpl, vars = {}) formatter.render(*tpl_params(tpl, vars)) end |
#run ⇒ Object
12 |
# File 'lib/cms_scanner/controller.rb', line 12 def run; end |
#target ⇒ Target
21 22 23 |
# File 'lib/cms_scanner/controller.rb', line 21 def target @@target ||= NS::Target.new([:url], ) end |
#user_interaction? ⇒ Boolean
65 66 67 |
# File 'lib/cms_scanner/controller.rb', line 65 def user_interaction? formatter.user_interaction? && ![:output] end |