Module: Arachni::Element::Capabilities::WithNode

Included in:
Auditable::DOM, WithDOM, Form, Link, LinkTemplate
Defined in:
lib/arachni/element/capabilities/with_node.rb

Overview

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#htmlString

Returns HTML code for the element.

Returns:

  • (String)

    HTML code for the element.



17
18
19
# File 'lib/arachni/element/capabilities/with_node.rb', line 17

def html
  @html
end

Instance Method Details

#dupObject



38
39
40
# File 'lib/arachni/element/capabilities/with_node.rb', line 38

def dup
    copy_with_node( super )
end

#initialize(options) ⇒ Object



19
20
21
22
# File 'lib/arachni/element/capabilities/with_node.rb', line 19

def initialize( options )
    super
    self.html = options[:html].freeze
end

#nodeNokogiri::XML::Element

Returns:

  • (Nokogiri::XML::Element)


29
30
31
32
# File 'lib/arachni/element/capabilities/with_node.rb', line 29

def node
    return if !@html
    Nokogiri::HTML.fragment( @html.dup ).children.first
end

#to_hObject



34
35
36
# File 'lib/arachni/element/capabilities/with_node.rb', line 34

def to_h
    super.merge( html: html )
end