Method: GoogleApps::Atom::Node#add_attributes
- Defined in:
- lib/google_apps/atom/node.rb
#add_attributes(node, attributes) ⇒ Object
add_attributes adds the specified attributes to the given node. It takes a LibXML::XML::Node and an array of name, value attribute pairs.
add_attribute node, [[‘title’, ‘emperor’], [‘name’, ‘Napoleon’]]
add_attribute returns the modified node.
59 60 61 62 63 64 65 |
# File 'lib/google_apps/atom/node.rb', line 59 def add_attributes(node, attributes) attributes.each do |attribute| node.attributes[attribute[0]] = attribute[1] end node end |