Method: GoogleApps::Atom::Feed#new_doc
- Defined in:
- lib/google_apps/atom/feed.rb
#new_doc(type, content_array, filters) ⇒ Object
new_doc creates a new Atom document from the data provided in the feed. new_doc takes a type, an array of content to be placed into the document as well as an array of filters.
new_doc ‘user’, content_array, [‘apps:’]
new_doc returns an GoogleApps::Atom document of the specified type.
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/google_apps/atom/feed.rb', line 60 def new_doc(type, content_array, filters) content_array = filters.inject([]) do |content, filter| content << grab_elements(content_array, filter) content end add_category content_array, type Atom.send type, entry_wrap(content_array.flatten).join("\n") end |