Sha256: 2df868213bd448f520901d64f51e95a8596ed4e71a72e92214501682bd454b55

Contents?: true

Size: 372 Bytes

Versions: 2

Compression:

Stored size: 372 Bytes

Contents

module PageMeta
  class MetaTag
    class Twitter < MetaTag
      def render
        return if content.empty?

        content.each_with_object("") do |(attr, value), buffer|
          next if value.blank?
          attr = attr.to_s.gsub(/_/, ":")
          buffer << helpers.tag(:meta, property: "twitter:#{attr}", content: value)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
page_meta-0.1.1 lib/page_meta/meta_tag/twitter.rb
page_meta-0.1.0 lib/page_meta/meta_tag/twitter.rb