Sha256: ebf6a94e9405cccf865591b87262d1b3e3c1257467ba559d5c1ddddc751d0223
Contents?: true
Size: 701 Bytes
Versions: 11
Compression:
Stored size: 701 Bytes
Contents
module Microformats2 module ImpliedProperty class Name < Foundation def method_name "name" end def to_s @to_s ||= element_value || selector_value || text_value end protected def name_map { "img" => "alt", "abbr" => "title" } end def selector_map { ">img[alt]:only-of-type" => "alt", ">abbr[title]:only-of-type" => "title", ">:only-of-type>img[alt]:only-of-type" => "alt", ">:only-of-type>abbr[title]:only-of-type" => "title" } end private def text_value @element.inner_text.gsub(/\n+/, " ").gsub(/\s+/, " ").strip end end end end
Version data entries
11 entries across 11 versions & 1 rubygems