Class: Arachni::UI::Web::Addons::Sample
- Defined in:
- lib/arachni/ui/web/addons/sample.rb
Overview
Sample add-on, see the code for examples.
Class Method Summary collapse
Instance Method Summary collapse
-
#run ⇒ Object
This method gets fired when the plugin is loaded.
-
#title ⇒ Object
This optional method allows you to specify the title which will be used for the menu (in case you want it to be dynamic).
Methods inherited from Base
#adelete, #aget, #apost, #aput, #delete, #get, #initialize, #path_addon, #path_root, #path_views, #post, #put, #settings
Constructor Details
This class inherits a constructor from Arachni::UI::Web::Addons::Base
Class Method Details
.info ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/arachni/ui/web/addons/sample.rb', line 69 def self.info { :name => 'Sample add-on', :description => %q{This add-on serves as an example/tutorial.}, :author => 'Tasos "Zapotek" Laskos <[email protected]> ', :version => '0.1' } end |
Instance Method Details
#run ⇒ Object
This method gets fired when the plugin is loaded.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/arachni/ui/web/addons/sample.rb', line 39 def run # # You can work with get/post/put/delete handlers just like # when using Sinatra. # get '/' do # # From inside the block you have access to regular Sinatra stuff # like sessions, helpers etc. # # session => Direct access to the session, *be careful!*. # settings => Direct access to the Sinatra methods, attributes, etc. # You can treat 'present' just like 'erb' with a default layout. present :index, :msg => 'world' end end |
#title ⇒ Object
This optional method allows you to specify the title which will be used for the menu (in case you want it to be dynamic).
65 66 67 |
# File 'lib/arachni/ui/web/addons/sample.rb', line 65 def title 'Sample' end |