class ActionView::Helpers::AtomFeedHelper::AtomBuilder

:nodoc:

def initialize(xml)

def initialize(xml)
  @xml = xml
end

def method_missing(method, *arguments, &block)

that an xhtml_block? is desired.
namespaced div element if the method and arguments indicate
Delegate to XML Builder, first wrapping the element in an XHTML
def method_missing(method, *arguments, &block)
  if xhtml_block?(method, arguments)
    @xml.__send__(method, *arguments) do
      @xml.div(xmlns: "http://www.w3.org/1999/xhtml") do |xhtml|
        block.call(xhtml)
      end
    end
  else
    @xml.__send__(method, *arguments, &block)
  end
end

def xhtml_block?(method, arguments)

if type: 'xhtml' is, in fact, specified.
in the Atom spec as potentially containing XHTML content and
True if the method name matches one of the five elements defined
def xhtml_block?(method, arguments)
  if XHTML_TAG_NAMES.include?(method.to_s)
    last = arguments.last
    last.is_a?(Hash) && last[:type].to_s == "xhtml"
  end
end