# File htree/doc.rb, line 56 def initialize(children=[]) # :notnew: @children = children.dup.freeze unless @children.all? {|c| c.kind_of?(HTree::Node) and !c.kind_of?(HTree::Doc) } unacceptable = @children.reject {|c| c.kind_of?(HTree::Node) and !c.kind_of?(HTree::Doc) } unacceptable = unacceptable.map {|uc| uc.inspect }.join(', ') raise TypeError, "Unacceptable document child: #{unacceptable}" end end