Class: RubyRest::Atom::FeedFormatter

Inherits:
DomainFormatter show all
Defined in:
lib/rubyrest/atom.rb

Instance Method Summary collapse

Methods inherited from DomainFormatter

#app, #initialize

Constructor Details

This class inherits a constructor from RubyRest::Atom::DomainFormatter

Instance Method Details

#format(objects, params) ⇒ Object



224
225
226
227
228
229
230
231
232
233
# File 'lib/rubyrest/atom.rb', line 224

def format( objects, params )
  params[:content_type]="application/atom+xml"
  xml = REXML::Document.new
  xml << REXML::XMLDecl.default
  feed = xml.add_element( "feed", NAMESPACES )
  feed.add_element( "id" ).add_text( params[:path] )
  feed.add_element( "title" ).add_text( params[:path] )
  objects.each{ |o| @parent.formatter_for_name(:entry).format_entry( o, feed, params ) } if objects 
  return xml
end