Class: ActionView::Helpers::AtomFeedHelper::AtomBuilder
- Defined in:
- actionview/lib/action_view/helpers/atom_feed_helper.rb
Overview
:nodoc:
Direct Known Subclasses
Constant Summary collapse
- XHTML_TAG_NAMES =
%w(content rights title subtitle summary).to_set
Instance Method Summary collapse
-
#initialize(xml) ⇒ AtomBuilder
constructor
A new instance of AtomBuilder.
Constructor Details
#initialize(xml) ⇒ AtomBuilder
Returns a new instance of AtomBuilder.
132 133 134 |
# File 'actionview/lib/action_view/helpers/atom_feed_helper.rb', line 132 def initialize(xml) @xml = xml end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *arguments, &block) ⇒ Object (private)
Delegate to XML Builder, first wrapping the element in an XHTML namespaced div element if the method and arguments indicate that an xhtml_block? is desired.
140 141 142 143 144 145 146 147 148 149 150 |
# File 'actionview/lib/action_view/helpers/atom_feed_helper.rb', line 140 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 |