Skip to content

Commit

Permalink
* lib/rexml/functions.rb: Add some documentation for REXML::Functions.
Browse files Browse the repository at this point in the history
	  Patch by Sebastian Martinez.  [Ruby 1.9 - Feature #4688]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
drbrain committed May 13, 2011
1 parent 172b1ba commit 8dca379
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
Sat May 14 02:54:04 2011 Eric Hodel <drbrain@segment7.net>

* lib/rexml/functions.rb: Add some documentation for REXML::Functions.
Patch by Sebastian Martinez. [Ruby 1.9 - Feature #4688]

Sat May 14 02:51:42 2011 Eric Hodel <drbrain@segment7.net>

* lib/resolv.rb: Hide private method and state-tracking constants from
Expand Down
7 changes: 7 additions & 0 deletions lib/rexml/functions.rb
Expand Up @@ -28,6 +28,7 @@ def Functions::text( )
end
end

# Returns the last node of the given list of nodes.
def Functions::last( )
@@context[:size]
end
Expand All @@ -36,6 +37,7 @@ def Functions::position( )
@@context[:index]
end

# Returns the size of the given list of nodes.
def Functions::count( node_set )
node_set.size
end
Expand Down Expand Up @@ -129,6 +131,11 @@ def Functions::string( object=nil )
end
end

# A node-set is converted to a string by
# returning the concatenation of the string-value
# of each of the children of the node in the
# node-set that is first in document order.
# If the node-set is empty, an empty string is returned.
def Functions::string_value( o )
rv = ""
o.children.each { |e|
Expand Down

0 comments on commit 8dca379

Please sign in to comment.