Module: Ronin::Support::Web::XML
- Defined in:
- lib/ronin/support/web/xml.rb,
lib/ronin/support/web/xml/mixin.rb
Overview
XML helper methods.
Defined Under Namespace
Modules: Mixin
Class Method Summary collapse
-
.build { ... } ⇒ Nokogiri::XML::Builder
Creates a new
Nokogiri::XML::Builder
. -
.open(path) {|doc| ... } ⇒ Nokogiri::XML::Document
Opens an XML file.
-
.parse(xml) {|doc| ... } ⇒ Nokogiri::XML::Document
Parses the body of a document into a HTML document object.
Class Method Details
.build { ... } ⇒ Nokogiri::XML::Builder
Creates a new Nokogiri::XML::Builder
.
104 105 106 |
# File 'lib/ronin/support/web/xml.rb', line 104 def self.build(&block) Nokogiri::XML::Builder.new(&block) end |
.open(path) {|doc| ... } ⇒ Nokogiri::XML::Document
Opens an XML file.
78 79 80 81 82 |
# File 'lib/ronin/support/web/xml.rb', line 78 def self.open(path) doc = Nokogiri::XML(File.open(path)) yield doc if block_given? return doc end |
.parse(xml) {|doc| ... } ⇒ Nokogiri::XML::Document
Parses the body of a document into a HTML document object.
50 51 52 53 54 |
# File 'lib/ronin/support/web/xml.rb', line 50 def self.parse(xml) doc = Nokogiri::XML.parse(xml) yield doc if block_given? return doc end |