Skip to content

Instantly share code, notes, and snippets.

@ender672
Created February 19, 2012 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ender672/1864519 to your computer and use it in GitHub Desktop.
Save ender672/1864519 to your computer and use it in GitHub Desktop.
diff --git a/lib/nokogiri/xml/node_set.rb b/lib/nokogiri/xml/node_set.rb
index 37b3848..149e90e 100644
--- a/lib/nokogiri/xml/node_set.rb
+++ b/lib/nokogiri/xml/node_set.rb
@@ -240,6 +240,14 @@ module Nokogiri
end
end
+ def map
+ a = []
+ length.times do |x|
+ a << yield(self[x])
+ end
+ a
+ end
+
###
# Get the inner text of all contained Node objects
def inner_text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment