Class: Burp::Page
- Inherits:
-
Object
- Object
- Burp::Page
- Defined in:
- app/lib/burp/page.rb
Instance Attribute Summary collapse
-
#snippets ⇒ Object
Returns the value of attribute snippets.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #[](location_name) ⇒ Object
- #[]=(location_name, value) ⇒ Object
-
#initialize(options = {}) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(options = {}) ⇒ Page
Returns a new instance of Page.
8 9 10 11 |
# File 'app/lib/burp/page.rb', line 8 def initialize( = {}) @snippets = [:snippets] || {} @title = [:title] || "" end |
Instance Attribute Details
#snippets ⇒ Object
Returns the value of attribute snippets.
6 7 8 |
# File 'app/lib/burp/page.rb', line 6 def snippets @snippets end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'app/lib/burp/page.rb', line 6 def title @title end |
Instance Method Details
#[](location_name) ⇒ Object
13 14 15 |
# File 'app/lib/burp/page.rb', line 13 def [](location_name) ("<!-- snippet data-type=\"start\" data-name=\"#{location_name}\" -->"+(@snippets[location_name.to_sym] || "<h2>#{location_name.to_s}</h2>")+"<!-- snippet data-type=\"end\" data-name=\"#{location_name}\" -->").html_safe end |
#[]=(location_name, value) ⇒ Object
17 18 19 |
# File 'app/lib/burp/page.rb', line 17 def []=(location_name,value) @snippets[location_name.to_sym] = value end |