Sha256: f8a1c4174e0b7393598906626ee598fca7eaf75ebd3f4cab2a36a203e30da6ce

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

module Html2rss
  ##
  # Provides a namespace for item extractors.
  module ItemExtractors
    DEFAULT = 'text'.freeze

    def self.get_extractor(name)
      @get_extractor ||= Hash.new do |extractors, key|
        extractors[key] = Utils.get_class_from_name(key || DEFAULT, 'ItemExtractors')
      end

      @get_extractor[name]
    end

    ##
    # @return [Nokogiri::XML::Element]
    def self.element(xml, options)
      selector = options[:selector]
      selector ? xml.css(selector) : xml
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
html2rss-0.8.2 lib/html2rss/item_extractors.rb