Sha256: d9301b408e493e0d77f60cc250c4fd14b36928164e8f4e1cecb4d8269ebc045e
Contents?: true
Size: 468 Bytes
Versions: 9
Compression:
Stored size: 468 Bytes
Contents
module Pakyow module Presenter class StringDocRenderer def self.render(structure) structure.flatten.reject(&:empty?).map { |s| s.is_a?(Hash) ? attrify(s) : s }.join end IGNORED_ATTRS = %i[container partial] def self.attrify(attrs) attrs.delete_if { |a| a.nil? || IGNORED_ATTRS.include?(a) }.map { |attr| attr[0].to_s + '="' + attr[1].to_s + '"' }.join(' ') end end end end
Version data entries
9 entries across 9 versions & 1 rubygems