module Utopia::Content::Namespace
A namespace which contains tags which can be rendered within a {Document}.
Attributes
named[R]
Public Class Methods
extended(other)
click to toggle source
# File lib/utopia/content/namespace.rb, line 27 def self.extended(other) other.class_exec do @named = {} end end
Public Instance Methods
call(name, node)
click to toggle source
@return [Node] The node which should be used to render the named tag.
# File lib/utopia/content/namespace.rb, line 49 def call(name, node) @named[name] end
freeze()
click to toggle source
Calls superclass method
# File lib/utopia/content/namespace.rb, line 35 def freeze return self if frozen? @named.freeze @named.values.each(&:freeze) super end
tag(name, klass = nil, &block)
click to toggle source
# File lib/utopia/content/namespace.rb, line 44 def tag(name, klass = nil, &block) @named[name] = klass || block end