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