Class: Burp::Page

Inherits:
Object
  • Object
show all
Defined in:
app/lib/burp/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  @snippets = options[:snippets] || {}
  @title = options[:title] || ""
end

Instance Attribute Details

#snippetsObject

Returns the value of attribute snippets.



6
7
8
# File 'app/lib/burp/page.rb', line 6

def snippets
  @snippets
end

#titleObject

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