class Nokogiri::XML::NodeSet

def inner_text

See Nokogiri::XML::Node#content for more information.

doc.css('d').map(&:text) # => ["foo", "bar"]

Instead, if you want to return the text of all nodes in the NodeSet:

doc.css('d').text # => "foobar"
doc = Nokogiri::XML('foobar')

Note: This joins the text of all Node objects in the NodeSet:

Get the inner text of all contained Node objects
##
def inner_text
  collect(&:inner_text).join("")
end