Sha256: f00d00b23bbcc95dd5610a38a5951b2ae0dfbd5f15efaa8e64f7dc4c9bbe67d0
Contents?: true
Size: 601 Bytes
Versions: 24
Compression:
Stored size: 601 Bytes
Contents
# frozen_string_literal: true module Maglev module Content class CollectionItem < Base def exists? item.present? end def to_s item.inspect end def item (content || {})[:item] end def tag(view_context, options = {}, &block) return unless item && block_given? view_context.tag.public_send( options.delete(:html_tag)&.to_sym || :div, view_context.capture(item, &block), **{ data: (options.delete(:data) || {}).merge(tag_data) }.merge(options) ) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems