Sha256: 97b1dbfcc1930541872888d510ca7034538baaa7f685c7473828496b6c09950e

Contents?: true

Size: 625 Bytes

Versions: 7

Compression:

Stored size: 625 Bytes

Contents

module Html2rss
  module AttributePostProcessors
    ##
    # 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'
    class ParseUri
      def initialize(value, _env)
        @value = value
      end

      ##
      # @return [String]
      def get
        URI(@value).to_s
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
html2rss-0.7.0 lib/html2rss/attribute_post_processors/parse_uri.rb
html2rss-0.6.0 lib/html2rss/attribute_post_processors/parse_uri.rb
html2rss-0.5.2 lib/html2rss/attribute_post_processors/parse_uri.rb
html2rss-0.5.1 lib/html2rss/attribute_post_processors/parse_uri.rb
html2rss-0.5.0 lib/html2rss/attribute_post_processors/parse_uri.rb
html2rss-0.4.1 lib/html2rss/attribute_post_processors/parse_uri.rb
html2rss-0.4.0 lib/html2rss/attribute_post_processors/parse_uri.rb