class Html2rss::AttributePostProcessors::ParseUri

Returns the URI as String.

Imagine this HTML structure:

<span>http://why-not-use-a-link.uh </span>

YAML usage example:

selectors:
  link:
    selector: span
    extractor: text
    post_process:
      name: parse_uri

Would return:

'http://why-not-use-a-link.uh'

Public Class Methods

new(value, _env) click to toggle source
# File lib/html2rss/attribute_post_processors/parse_uri.rb, line 22
def initialize(value, _env)
  @value = value
end

Public Instance Methods

get() click to toggle source

@return [String]

# File lib/html2rss/attribute_post_processors/parse_uri.rb, line 28
def get
  URI(Html2rss::Utils.sanitize_url(@value)).to_s
end