Class Mechanize::Page::MetaRefresh
In: lib/mechanize/page/meta_refresh.rb
Parent: Mechanize::Page::Link

This class encapsulates a meta element with a refresh http-equiv. Mechanize treats meta refresh elements just like ‘a’ tags. MetaRefresh objects will contain links, but most likely will have no text.

Methods

from_node   new   noreferrer?   parse  

Constants

CONTENT_REGEXP = /^\s*(\d+\.?\d*)\s*(?:;(?:\s*url\s*=\s*(['"]?)(\S*)\2)?\s*)?$/i   Matches the content attribute of a meta refresh element. After the match:
  $1:: delay
  $3:: url
UNSAFE = /[^\-_.!~*'()a-zA-Z\d;\/?:@&%=+$,\[\]]/   Regexp of unsafe URI characters that excludes % for Issue 177

Attributes

delay  [R]  Time to wait before next refresh
link_self  [R]  This MetaRefresh links did not contain a url= in the content attribute and links to itself.

Public Class methods

Parses the delay and url from the content attribute of a meta refresh element.

Returns an array of [delay, url, link_self], where the first two are strings containing the respective parts of the refresh value, and link_self is a boolean value that indicates whether the url part is missing or empty. If base_uri, the URI of the current page is given, the value of url becomes an absolute URI.

Public Instance methods

[Validate]