Sha256: ebfc55769e255782269e4c63b136025b36a1785b1c6d6d936811b3a03487f08f
Contents?: true
Size: 698 Bytes
Versions: 11
Compression:
Stored size: 698 Bytes
Contents
module Html2rss module ItemExtractors ## # Return the text of the attribute. This is the default extractor used, # when no extractor is explicitly given. # # Imagine this HTML structure: # # <p>Lorem <b>ipsum</b> dolor ...</p> # # YAML usage example: # # selectors: # description: # selector: p # extractor: text # # Would return: # 'Lorem ipsum dolor ...' class Text def initialize(xml, options) @element = ItemExtractors.element(xml, options) end ## # @return [String] def get @element.text.to_s.strip.split.join(' ') end end end end
Version data entries
11 entries across 11 versions & 1 rubygems