Class: Html2rss::AttributePostProcessors::ParseUri

Inherits:
Object
  • Object
show all
Defined in:
lib/html2rss/attribute_post_processors/parse_uri.rb

Overview

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'

Instance Method Summary collapse

Constructor Details

#initialize(value, _options, _item) ⇒ ParseUri

Returns a new instance of ParseUri



21
22
23
# File 'lib/html2rss/attribute_post_processors/parse_uri.rb', line 21

def initialize(value, _options, _item)
  @value = value
end

Instance Method Details

#getString

Returns:

  • (String)


27
28
29
# File 'lib/html2rss/attribute_post_processors/parse_uri.rb', line 27

def get
  URI(@value).to_s
end