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
12
13
# File 'app/lib/burp/page.rb', line 8

def initialize(options = {})
  @snippets = options[:snippets] || {}
  @title = options[:title] || ""
  @page_id = options[:page_id] || ""
  @meta_description = options[:meta_description] || ""
end

Instance Attribute Details

#meta_descriptionObject

Returns the value of attribute meta_description


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

def meta_description
  @meta_description
end

#page_idObject

Returns the value of attribute page_id


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

def page_id
  @page_id
end

#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


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