Sha256: 5326f876cf349c39ef56322be551486a7be92c0920bd58b6a98b64a24d5673df
Contents?: true
Size: 688 Bytes
Versions: 12
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true # Released under the MIT License. # Copyright, 2017-2022, by Samuel Williams. module Utopia class Content # A namespace which contains tags which can be rendered within a {Document}. module Namespace def self.extended(other) other.class_exec do @named = {} end end attr :named def freeze return self if frozen? @named.freeze @named.values.each(&:freeze) super end def tag(name, klass = nil, &block) @named[name] = klass || block end # @return [Node] The node which should be used to render the named tag. def call(name, node) @named[name] end end end end
Version data entries
12 entries across 12 versions & 1 rubygems