Sha256: a1cf4e863d9e25057b795a61caab6ae232eceaa06dfacc11731a3e6c7e30cb3a

Contents?: true

Size: 374 Bytes

Versions: 2

Compression:

Stored size: 374 Bytes

Contents

# frozen_string_literal: true

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

      content.each_with_object([]) do |(attr, value), buffer|
        next if value.blank?

        attr = attr.to_s.tr("_", ":")
        buffer << helpers.tag(:meta, property: "#{base_name}:#{attr}", content: value)
      end.join
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
page_meta-1.1.0 lib/page_meta/hash_meta_tag.rb
page_meta-1.0.0 lib/page_meta/hash_meta_tag.rb