Class: Burp::Page
- Inherits:
-
Object
- Object
- Burp::Page
- Defined in:
- app/lib/burp/page.rb
Instance Attribute Summary collapse
-
#meta_description ⇒ Object
Returns the value of attribute meta_description.
-
#page_id ⇒ Object
Returns the value of attribute page_id.
-
#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 12 13 |
# File 'app/lib/burp/page.rb', line 8 def initialize( = {}) @snippets = [:snippets] || {} @title = [:title] || "" @page_id = [:page_id] || "" @meta_description = [:meta_description] || "" end |
Instance Attribute Details
#meta_description ⇒ Object
Returns the value of attribute meta_description.
6 7 8 |
# File 'app/lib/burp/page.rb', line 6 def @meta_description end |
#page_id ⇒ Object
Returns the value of attribute page_id.
6 7 8 |
# File 'app/lib/burp/page.rb', line 6 def page_id @page_id end |
#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
15 16 17 |
# File 'app/lib/burp/page.rb', line 15 def [](location_name) ("<!-- snippet data-type=\"start\" data-page-id=\"#{page_id}\" 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
19 20 21 |
# File 'app/lib/burp/page.rb', line 19 def []=(location_name,value) @snippets[location_name.to_sym] = value end |