lib/google_apps/atom/document.rb in google_apps-0.4.9.1 vs lib/google_apps/atom/document.rb in google_apps-0.4.9.2
- old
+ new
@@ -47,13 +47,14 @@
def find_values # Moved from User and Group, causing segfault but only at odd times
map_key = self.class.to_s.split(':').last.downcase.to_sym
map = Atom::MAPS[map_key]
@document.root.each do |entry|
- unless entry.name.match 'gd' or entry.name.match 'atom' or entry.name.match 'openSearch'
- entry.attributes.each do |attribute|
- instance_variable_set "@#{map[attribute.name.to_sym]}", check_value(attribute.value)
+ intersect = map.keys & entry.attributes.to_h.keys.map(&:to_sym)
+ unless intersect.empty?
+ intersect.each do |attribute|
+ instance_variable_set "@#{map[attribute]}", check_value(entry.attributes[attribute])
end
end
end
end
@@ -110,10 +111,10 @@
case type_to_s
when 'group', 'groupmember'
ns[:gd] = Atom::NAMESPACES[:gd]
end
- ns
+ ns
end
end
end
end
\ No newline at end of file