lib/hexp/node/children.rb in hexp-0.3.3 vs lib/hexp/node/children.rb in hexp-0.4.0.beta1

- old
+ new

@@ -70,13 +70,14 @@ # @param [Array,Hexp::NodeList] new_children # # @return [Hexp::Node] # # @api public - def set_children(new_children) - H[tag, attributes, new_children] + def content(*args) + H[tag, attributes, *args] end + alias set_children content # Perform an action on each child node, and replace the node with the result # # @example # H[:div, [H[:span, "foo"]]].map_children do |node| @@ -92,8 +93,9 @@ # @api public def map_children(&blk) return to_enum(:map_children) unless block_given? H[tag, attributes, children.map(&blk)] end + end end end