Method: GoogleApps::Atom::Document#build_root
- Defined in:
- lib/google_apps/atom/document.rb
#build_root(type) ⇒ Object
build_root creates the shared root structure for the document.
build_root
build_root returns an atom:entry node with an apps:category element appropriate for the document type.
184 185 186 187 188 189 190 191 |
# File 'lib/google_apps/atom/document.rb', line 184 def build_root(type) root = create_node(type: 'atom:entry') add_namespaces root, determine_namespaces(type) root << create_node(type: 'apps:category', attrs: Atom::CATEGORY[type.to_sym]) if Atom::CATEGORY[type.to_sym] root end |